1 /**********
2 Copyright 1990 Regents of the University of California.  All rights reserved.
3 **********/
4 
5 #ifndef ngspice_SENSDEFS_H
6 #define ngspice_SENSDEFS_H
7 
8 #include "ngspice/jobdefs.h"
9 
10     /* structure used to describe an Adjoint Sensitivity analysis */
11 
12 typedef struct st_sens SENS_AN;
13 typedef struct st_devsen DevSenList;
14 typedef struct st_modsen ModSenList;
15 typedef struct st_devsen ParamSenList;
16 typedef struct st_nodes Nodes;
17 typedef struct st_output output;
18 
19 struct st_sens {
20     int		JOBtype;
21     JOB		*JOBnextJob;    /* pointer to next thing to do */
22     char	*JOBname;      /* name of this job */
23 
24     DevSenList	*first;
25     double	start_freq;
26     double	stop_freq;
27 
28     int		step_type;
29     int		n_freq_steps;
30 
31     CKTnode	*output_pos, *output_neg;
32     IFuid	output_src;
33     char	*output_name;
34     int		output_volt;
35 
36     double	deftol;
37     double	defperturb;
38     unsigned int pct_flag :1;
39 
40 };
41 
42 struct st_output {
43 	int	type;
44 	int	pos, neg;
45 };
46 
47 struct st_nodes {
48 	int	pos, neg;
49 };
50 
51 struct st_paramsenlist {
52 	ParamSenList	*next;
53 	int		param_no;
54 	double		delta, tol;
55 };
56 
57 struct st_modsenlist {
58 	ModSenList	*next;
59 	int		mod_no;
60 	ParamSenList	*first;
61 };
62 
63 struct st_devsenlist {
64 	DevSenList	*next;
65 	int		dev_no;
66 	ModSenList	*first;
67 };
68 
69 /* va, with prototypes */
70 extern int SENSask(CKTcircuit *,JOB *,int ,IFvalue *);
71 extern int SENSsetParam(CKTcircuit *,JOB *,int ,IFvalue *);
72 extern int sens_sens(CKTcircuit *,int);
73 
74 enum {
75     SENS_POS = 2,
76     SENS_NEG,
77     SENS_SRC,
78     SENS_NAME,
79 };
80 
81 enum {
82     SENS_START = 10,
83     SENS_STOP,
84     SENS_STEPS,
85     SENS_DECADE,
86     SENS_OCTAVE,
87     SENS_LINEAR,
88     SENS_DC,
89     SENS_DEFTOL,
90     SENS_DEFPERTURB,
91     SENS_DEVDEFTOL,
92     SENS_DEVDEFPERT,
93     SENS_TYPE,
94     SENS_DEVICE,
95 };
96 
97 enum {
98     SENS_PARAM = 24,
99     SENS_TOL,
100     SENS_PERT,
101 };
102 
103 #endif /*DEFS*/
104 
105