Qucs-core  0.0.18
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
qucs_interface.h
Go to the documentation of this file.
1 /*
2  * qucs_interface.h - m-code interface class definitions
3  *
4  * Copyright (C) 2003, 2004, 2005, 2006, 2007 Stefan Jahn <stefan@lkcc.org>
5  *
6  * This is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2, or (at your option)
9  * any later version.
10  *
11  * This software is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this package; see the file COPYING. If not, write to
18  * the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor,
19  * Boston, MA 02110-1301, USA.
20  *
21  * $Id: analysis.h 1869 2013-03-06 12:50:21Z crobarcro $
22  *
23  */
24 
35 #ifndef __QUCS_INTERFACE_H__
36 #define __QUCS_INTERFACE_H__
37 
38 
39 namespace qucs
40 {
41 
42 
43 enum QUCS_ERROR_CODES { NETLIST_OK,
44  NETLIST_FILE_NOT_FOUND,
45  NETLIST_FAILED_CHECK };
46 
47 // forward declarations of some classes to avoid including
48 // header files and speed compilation
49 class net;
50 class input;
51 class circuit;
52 class dataset;
53 class environment;
54 class e_trsolver;
55 
64 class qucsint
65 {
66 
67 public:
68  qucsint ();
69  qucsint (char* infile);
70  ~qucsint ();
71 
72  int prepare_netlist (char* infile);
73  int evaluate ();
74  int output (char* outfile);
75 
76 protected:
77 
78  qucs::net * subnet;
79  qucs::input * in;
80  qucs::circuit * gnd;
81  qucs::dataset * out;
82  qucs::environment * root;
83  int err;
84  int ret;
85 
86 };
87 
88 
89 /*/////////////////////////////////////////////////////////////////////////////
90 
91  trsolver_interface
92 
94 
95 
96 enum ETR_MODE { ETR_MODE_ASYNC, ETR_MODE_SYNC };
97 
107 class trsolver_interface : public qucsint
108 {
109 public:
110  trsolver_interface ();
111  trsolver_interface (char* infile);
112 // ~trsolver_interface ();
113 
114  void getETR(void);
115  int init (double, double, int);
116  bool getIsInitialised() { return isInitialised; };
117  int stepsolve_sync (double synctime);
118  void acceptstep_sync (void);
119  int stepsolve_async (double steptime);
120  void acceptstep_async (void);
121  void rejectstep_async (void);
122  void getsolution (double *);
123 
125  int getN ();
126 
128  int getM ();
129 
152  int setECVSVoltage(char * ecvsname, double V);
153 
155  int getJacRows ();
156 
158  int getJacCols ();
159 
166  int getJacData (int r, int c, double& data);
167 
178  int getNodeV (char * label, double& nodeV);
179 
190  int getVProbeV (char * probename, double& probeV);
191 
202  int getIProbeI (char * probename, double& probeI);
203 
220  void setMessageFcn (void (*newmessagefcn)(int level, const char * format, ...));
221 
222  // debugging functions
223 // void debug (void);
230  void printSolution (void);
231 
232 private:
233 
234  bool isInitialised;
236  qucs::e_trsolver * etr;
237 
238 };
239 
240 } // namespace qucs
241 
242 #endif /* __QUCS_INTERFACE_H__ */
Houses the settings for netlist evaluation.
Definition: environment.h:51
base class for qucs circuit elements.
Definition: circuit.h:92
Definition: net.h:39