⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cktpzld.c

📁 spice中支持多层次元件模型仿真的可单独运行的插件源码
💻 C
字号:
/**********Copyright 1990 Regents of the University of California.  All rights reserved.**********/#include "spice.h"#include <stdio.h>#include "pzdefs.h"#include "smpdefs.h"#include "cktdefs.h"#include "complex.h"#include "devdefs.h"#include "sperror.h"#include "suffix.h"extern SPICEdev *DEVices[];intCKTpzLoad(ckt, s)    CKTcircuit *ckt;    SPcomplex *s;{    PZAN *pzan = (PZAN *) (ckt->CKTcurJob);    SMPelement *elt, *telt;    int solution_col;    int error;    int i;#ifdef PARALLEL_ARCH    long type = MT_PZLOAD, length = 1;#endif /* PARALLEL_ARCH */    for (i = 0; i <= SMPmatSize(ckt->CKTmatrix); i++) {	ckt->CKTrhs[i] = 0.0;	ckt->CKTirhs[i] = 0.0;    }    SMPcClear(ckt->CKTmatrix);    for (i = 0; i < DEVmaxnum; i++) {        if (DEVices[i]->DEVpzLoad != NULL && ckt->CKThead[i] != NULL) {            error = (*DEVices[i]->DEVpzLoad)(ckt->CKThead[i], ckt, s);#ifdef PARALLEL_ARCH	    if (error) goto combine;#else            if(error) return(error);#endif /* PARALLEL_ARCH */        }    }#ifdef PARALLEL_ARCHcombine:    /* See if any of the DEVload functions bailed. If not, proceed. */    IGOP_( &type, &error, &length, "max" );    if (error == OK) {      SMPcCombine( ckt->CKTmatrix, ckt->CKTrhs, ckt->CKTrhsSpare,	  ckt->CKTirhs, ckt->CKTirhsSpare );    } else {      return(error);    }#endif /* PARALLEL_ARCH */#ifdef notdef    printf("*** Before PZ adjustments *\n");    SMPprint(ckt->CKTmatrix, stdout);#endif    if (pzan->PZbalance_col && pzan->PZsolution_col) {	SMPcAddCol(ckt->CKTmatrix, pzan->PZbalance_col, pzan->PZsolution_col);	/* AC sources ?? XXX */    }    if (pzan->PZsolution_col) {	SMPcZeroCol(ckt->CKTmatrix, pzan->PZsolution_col);    }    /* Driving function (current source) */    if (pzan->PZdrive_pptr)	*pzan->PZdrive_pptr = 1.0;    if (pzan->PZdrive_nptr)	*pzan->PZdrive_nptr = -1.0;#ifdef notdef    printf("*** After PZ adjustments *\n");    SMPprint(ckt->CKTmatrix, stdout);#endif    return(OK);}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -