__ses_path_split_i()
authoryu.dongliang <18588496441@163.com>
Sun, 10 Sep 2023 05:42:54 +0000 (13:42 +0800)
committeryu.dongliang <18588496441@163.com>
Sun, 10 Sep 2023 05:42:54 +0000 (13:42 +0800)
ses_step_va_diode.c

index a98d1a480facc58df4043e27fe6b65341a368802..cdd57be012981b53b2f77706178154ef53ca61ad 100644 (file)
@@ -27,21 +27,25 @@ void __ses_path_split_i(ses_path_t* path, ScfEpin* p0, ScfEpin* p1, double la, d
                *a  -= child->a;
                *ja -= child->ja;
 
-               cp0->a  = child->a;
-               cp0->ja = child->ja;
                cp1->a  = child->a;
                cp1->ja = child->ja;
 
+               if (child->childs)
+                       __ses_path_split_i(child, cp0, cp1, child->a, child->ja, &cp1->a, &cp1->ja);
+
+               cp0->a  = cp1->a;
+               cp0->ja = cp1->ja;
+
                double cr;
                double jcr;
 
-               ses_ui_r(&cp1->dr, &cp1->jdr, v, jv, child->a, child->ja);
+               ses_ui_r(&cp1->dr, &cp1->jdr, v, jv, cp1->a, cp1->ja);
 
-               cp1->dr  -= child->r;
-               cp1->jdr -= child->jr;
+               cp1->dr  -= cp1->sr;
+               cp1->jdr -= cp1->jsr;
 
-               scf_loge("j: %d, c%ldp%ld--c%ldp%ld, v: %lg + j%lg, child->r: %lg + j%lg, child->a: %lg + j%lg, el->a: %lg + j%lg, cp1->dr: %lg + j%lg\n",
-                               j, cp0->cid, cp0->id, cp1->cid, cp1->id, v, jv, child->r, child->jr, child->a, child->ja, la, jla, cp1->dr, cp1->jdr);
+               scf_loge("j: %d, c%ldp%ld--c%ldp%ld, v: %lg + j%lg, child->r: %lg + j%lg, cp1->a: %lg + j%lg, el->a: %lg + j%lg, cp1->dr: %lg + j%lg\n",
+                               j, cp0->cid, cp0->id, cp1->cid, cp1->id, v, jv, child->r, child->jr, cp1->a, cp1->ja, la, jla, cp1->dr, cp1->jdr);
        }
 }