Jspice3
Main Page
Data Structures
Files
File List
Globals
ckttroub.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
#include "
spice.h
"
9
#include "
misc.h
"
10
#include "
devdefs.h
"
11
#include "
util.h
"
12
#include "
cktext.h
"
13
14
extern
SPICEdev
*
DEVices
[];
15
16
char
*
17
CKTtrouble
(inCkt, optmsg)
18
19
GENERIC
*inCkt;
20
char
*optmsg;
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
,
39
DEVices[ckt->
CKTtroubleElt
->
GENmodPtr
->
GENmodType
]
40
->
DEVpublic
.
name
,
41
ckt->
CKTtroubleElt
->
GENmodPtr
->
GENmodName
,
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
}
CKTcircuit::CKTtime
double CKTtime
Definition:
cktdefs.h:77
misc.h
CKTcircuit::CKTtroubleElt
GENinstance * CKTtroubleElt
Definition:
cktdefs.h:229
strcpy
char * strcpy()
CKTcircuit::CKTdelta
double CKTdelta
Definition:
cktdefs.h:78
CKTcircuit
Definition:
cktdefs.h:62
CKTcircuit::CKTtroubleNode
int CKTtroubleNode
Definition:
cktdefs.h:228
SPICEdev::DEVpublic
IFdevice DEVpublic
Definition:
devdefs.h:44
CKTnodName
IFuid CKTnodName()
MALLOC
#define MALLOC(x)
Definition:
util.h:9
NULL
#define NULL
Definition:
spdefs.h:121
CKTtrouble
char * CKTtrouble(GENERIC *inCkt, char *optmsg)
Definition:
ckttroub.c:17
util.h
spice.h
sIFdevice::name
char * name
Definition:
ifsim.h:293
sGENmodel::GENmodType
int GENmodType
Definition:
gendefs.h:40
cktext.h
SPICEdev
Definition:
devdefs.h:43
DEVices
SPICEdev * DEVices[]
Definition:
sconfig.c:109
sGENinstance::GENmodPtr
struct sGENmodel * GENmodPtr
Definition:
gendefs.h:25
sGENinstance::GENname
IFuid GENname
Definition:
gendefs.h:28
devdefs.h
GENERIC
char GENERIC
Definition:
ifsim.h:27
sGENmodel::GENmodName
IFuid GENmodName
Definition:
gendefs.h:45
src
lib
ckt
ckttroub.c
Generated by
1.8.11