2001-04-20 09:31:30 +02:00
|
|
|
/**********
|
|
|
|
|
Copyright 1999 AG inc. All rights reserved.
|
|
|
|
|
Author: 1999 Alan Gillespie
|
|
|
|
|
**********/
|
|
|
|
|
|
2001-04-22 12:08:46 +02:00
|
|
|
#include "ngspice.h"
|
2004-01-11 19:38:20 +01:00
|
|
|
#include "cktdefs.h"
#include "suffix.h"
|
2001-04-20 09:31:30 +02:00
|
|
|
|
|
|
|
|
void
|
|
|
|
|
CKTncDump(ckt)
|
|
|
|
|
CKTcircuit *ckt;
|
|
|
|
|
{
|
|
|
|
|
CKTnode *node;
|
|
|
|
|
double new, old, tol;
|
|
|
|
|
int i=1;
|
|
|
|
|
|
|
|
|
|
fprintf(stdout,"\n");
|
|
|
|
|
fprintf(stdout,"Last Node Voltages\n");
|
|
|
|
|
fprintf(stdout,"------------------\n\n");
|
|
|
|
|
fprintf(stdout,"%-30s %20s %20s\n", "Node", "Last Voltage", "Previous Iter");
|
|
|
|
|
fprintf(stdout,"%-30s %20s %20s\n", "----", "------------", "-------------");
|
|
|
|
|
for(node=ckt->CKTnodes->next;node;node=node->next) {
|
|
|
|
|
if (strstr(node->name, "#branch") || !strstr(node->name, "#")) {
|
|
|
|
|
new = *((ckt->CKTrhsOld) + i ) ;
|
|
|
|
|
old = *((ckt->CKTrhs) + i ) ;
|
|
|
|
|
fprintf(stdout,"%-30s %20g %20g", node->name, new, old);
|
|
|
|
|
if(node->type == 3) {
|
2001-04-22 12:08:46 +02:00
|
|
|
tol = ckt->CKTreltol * (MAX(fabs(old),fabs(new))) +
|
2001-04-20 09:31:30 +02:00
|
|
|
ckt->CKTvoltTol;
|
|
|
|
|
} else {
|
2001-04-22 12:08:46 +02:00
|
|
|
tol = ckt->CKTreltol * (MAX(fabs(old),fabs(new))) +
|
2001-04-20 09:31:30 +02:00
|
|
|
ckt->CKTabstol;
|
|
|
|
|
}
|
2001-04-22 12:08:46 +02:00
|
|
|
if (fabs(new-old) >tol ) {
|
2001-04-20 09:31:30 +02:00
|
|
|
fprintf(stdout," *");
|
|
|
|
|
}
|
|
|
|
|
fprintf(stdout,"\n");
|
|
|
|
|
};
|
|
|
|
|
i++;
|
|
|
|
|
};
|
|
|
|
|
fprintf(stdout,"\n");
|
|
|
|
|
}
|