Jspice3
cktaccpt.c
Go to the documentation of this file.
1 /***************************************************************************
2 JSPICE3 adaptation of Spice3f2 - Copyright (c) Stephen R. Whiteley 1992
3 Copyright 1990 Regents of the University of California. All rights reserved.
4 Authors: 1985 Thomas L. Quarles
5  1993 Stephen R. Whiteley
6 ****************************************************************************/
7 
8 
9 #include "spice.h"
10 #include <stdio.h>
11 #include "devdefs.h"
12 #include "sperror.h"
13 #include "util.h"
14 #include "cktext.h"
15 
16 
17 int
19 
20 /*
21  * this is a driver program to iterate through all the various
22  * accept functions provided for the circuit elements in the
23  * given circuit
24  */
25 CKTcircuit *ckt;
26 {
27  extern SPICEdev *DEVices[];
28  int i;
29  int size;
30  int error;
31  double *temp;
32  struct sCKTmodHead *mh;
33  int (*func)();
34 
35  for (mh = ckt->CKTheadList; mh != NULL; mh = mh->next) {
36  if ((func = DEVices[mh->type]->DEVaccept) != NULL) {
37  error = (*func)(ckt,mh->head);
38  if (error) return (error);
39  }
40  }
41 
42  /* now, move the sols vectors around */
43  temp = ckt->CKTsols[7];
44  for (i = 7; i > 0; i--) {
45  ckt->CKTsols[i] = ckt->CKTsols[i-1];
46  }
47  ckt->CKTsols[0] = temp;
48  size = spGetSize(ckt->CKTmatrix,1);
49  /* CKTrhsOld contains the last solution */
50  for (i = 0; i <= size; i++) {
51  ckt->CKTsols[0][i] = ckt->CKTrhsOld[i];
52  }
53  return (OK);
54 }
int CKTaccept(CKTcircuit *ckt)
Definition: cktaccpt.c:18
struct sCKTmodHead * next
Definition: cktdefs.h:58
SPICEdev * DEVices[]
Definition: sconfig.c:109
#define OK
Definition: iferrmsg.h:17
#define NULL
Definition: spdefs.h:121
int spGetSize()
Definition: fteparse.h:37
int type
Definition: cktdefs.h:56
GENmodel * head
Definition: cktdefs.h:57
int(* DEVaccept)()
Definition: devdefs.h:99