Jspice3
ckttroub.c File Reference
#include "spice.h"
#include "misc.h"
#include "devdefs.h"
#include "util.h"
#include "cktext.h"
Include dependency graph for ckttroub.c:

Go to the source code of this file.

Functions

char * CKTtrouble (GENERIC *inCkt, char *optmsg)
 

Variables

SPICEdevDEVices []
 

Function Documentation

char* CKTtrouble ( GENERIC inCkt,
char *  optmsg 
)

Definition at line 17 of file ckttroub.c.

21 {
22  CKTcircuit *ckt = (CKTcircuit*)inCkt;
23  char msg_buf[513];
24  char *emsg;
25 
26  if (!ckt)
27  return (NULL);
28  if (!optmsg)
29  optmsg = "";
30  if (ckt->CKTtroubleNode)
31  sprintf(msg_buf, "%s%sTime: %g, Timestep %g: trouble with %s\n",
32  optmsg, optmsg && *optmsg ? "; " : "",
33  ckt->CKTtime, ckt->CKTdelta,
34  CKTnodName(ckt, ckt->CKTtroubleNode));
35  else if (ckt->CKTtroubleElt)
36  sprintf(msg_buf, "Time: %g, Timestep %g: trouble with %s:%s:%s\n",
37  optmsg, optmsg && *optmsg ? "; " : "",
38  ckt->CKTtime, ckt->CKTdelta,
40  ->DEVpublic.name,
42  ckt->CKTtroubleElt->GENname);
43  else
44  sprintf(msg_buf,
45  "Time: %g, Timestep %g: Non convergence problem detected.\n",
46  ckt->CKTtime, ckt->CKTdelta);
47 
48  emsg = MALLOC(strlen(msg_buf)+1);
49  strcpy(emsg,msg_buf);
50 
51  return (emsg);
52 }
double CKTtime
Definition: cktdefs.h:77
GENinstance * CKTtroubleElt
Definition: cktdefs.h:229
char * strcpy()
double CKTdelta
Definition: cktdefs.h:78
int CKTtroubleNode
Definition: cktdefs.h:228
IFdevice DEVpublic
Definition: devdefs.h:44
IFuid CKTnodName()
#define MALLOC(x)
Definition: util.h:9
#define NULL
Definition: spdefs.h:121
char * name
Definition: ifsim.h:293
int GENmodType
Definition: gendefs.h:40
SPICEdev * DEVices[]
Definition: sconfig.c:109
struct sGENmodel * GENmodPtr
Definition: gendefs.h:25
IFuid GENname
Definition: gendefs.h:28
IFuid GENmodName
Definition: gendefs.h:45

Variable Documentation

SPICEdev* DEVices[]

Definition at line 109 of file sconfig.c.