Qucs-core
0.0.19
|
subclass for interfacing to the Qucs transient circuit solvers. More...
#include <qucs_interface.h>
Public Member Functions | |
trsolver_interface () | |
trsolver_interface (char *infile) | |
void | getETR (void) |
int | init (double, double, int) |
bool | getIsInitialised () |
int | stepsolve_sync (double synctime) |
void | acceptstep_sync (void) |
int | stepsolve_async (double steptime) |
void | acceptstep_async (void) |
void | rejectstep_async (void) |
void | getsolution (double *) |
int | getN () |
Returns the number of node voltages in the circuit. | |
int | getM () |
Returns the number of branch currents in the circuit. | |
int | setECVSVoltage (char *ecvsname, double V) |
Sets the voltage of an exterally controlled voltage source. | |
int | getJacRows () |
Returns the number of rows in the Jacobian matrix for the circuit. | |
int | getJacCols () |
Returns the number of columns in the Jacobian matrix for the circuit. | |
int | getJacData (int r, int c, double &data) |
Obtains the data from the Jacobian matrix for the circuit. | |
int | getNodeV (char *label, double &nodeV) |
Obtains the voltage of a node by name. | |
int | getVProbeV (char *probename, double &probeV) |
Obtains the voltage reported by a voltage probe. | |
int | getIProbeI (char *probename, double &probeI) |
Obtains the current reported by a current probe. | |
void | setMessageFcn (void(*newmessagefcn)(int level, const char *format,...)) |
Sets pointer to function used to print messages during a sim. | |
void | printSolution (void) |
Prints the histor of solutions available to the integrators at the current time step. | |
Private Attributes | |
bool | isInitialised |
qucs::e_trsolver * | etr |
Pointer to etr sim. |
subclass for interfacing to the Qucs transient circuit solvers.
This class is used for interfacing the qucs transient circuit solver with external software.
Definition at line 107 of file qucs_interface.h.
trsolver_interface::trsolver_interface | ( | ) |
Definition at line 184 of file qucs_interface.cpp.
trsolver_interface::trsolver_interface | ( | char * | infile | ) |
Definition at line 191 of file qucs_interface.cpp.
void trsolver_interface::acceptstep_async | ( | void | ) |
Definition at line 263 of file qucs_interface.cpp.
void trsolver_interface::acceptstep_sync | ( | void | ) |
Definition at line 252 of file qucs_interface.cpp.
void trsolver_interface::getETR | ( | void | ) |
Definition at line 222 of file qucs_interface.cpp.
int trsolver_interface::getIProbeI | ( | char * | probename, |
double & | probeI | ||
) |
Obtains the current reported by a current probe.
probename | Pointer to character array containing the name of the probe |
probeI | Reference to double in which the current will be returned |
This method searches for the current probe with the given name in probename. If the probe exists, the value of the probe current is copied to probeI. Returns 0 if the probe with the given name was found and -1 otherwise.
Definition at line 342 of file qucs_interface.cpp.
bool qucs::trsolver_interface::getIsInitialised | ( | ) | [inline] |
Definition at line 116 of file qucs_interface.h.
int trsolver_interface::getJacCols | ( | ) |
Returns the number of columns in the Jacobian matrix for the circuit.
Definition at line 290 of file qucs_interface.cpp.
Obtains the data from the Jacobian matrix for the circuit.
r | Pointer to character array containing the name of the voltage |
c | Reference to double in which the node voltage will be returned |
Definition at line 296 of file qucs_interface.cpp.
int trsolver_interface::getJacRows | ( | ) |
Returns the number of rows in the Jacobian matrix for the circuit.
Definition at line 284 of file qucs_interface.cpp.
int trsolver_interface::getM | ( | void | ) |
Returns the number of branch currents in the circuit.
Definition at line 215 of file qucs_interface.cpp.
int trsolver_interface::getN | ( | void | ) |
Returns the number of node voltages in the circuit.
Definition at line 209 of file qucs_interface.cpp.
int trsolver_interface::getNodeV | ( | char * | label, |
double & | nodeV | ||
) |
Obtains the voltage of a node by name.
label | Pointer to character array containing the name of the voltage |
nodeV | Reference to double in which the node voltage will be returned |
This method searches for the node with the given name in label. If the node exists, the value of the voltage at that node is copied to nodeV. Returns 0 if the node was found, and -1 otherwise.
Definition at line 311 of file qucs_interface.cpp.
void trsolver_interface::getsolution | ( | double * | sol | ) |
Definition at line 273 of file qucs_interface.cpp.
int trsolver_interface::getVProbeV | ( | char * | probename, |
double & | probeV | ||
) |
Obtains the voltage reported by a voltage probe.
probename | Pointer to character array containing the name of the probe |
probeV | Reference to double in which the node voltage will be returned |
This method searches for the voltage probe with the given name in probename. If the probe exists, the value of the probe voltage is copied to probeV. Returns 0 if the probe with the given name was found and -1 otherwise.
Definition at line 326 of file qucs_interface.cpp.
Definition at line 239 of file qucs_interface.cpp.
void trsolver_interface::printSolution | ( | void | ) |
Prints the histor of solutions available to the integrators at the current time step.
The history of soliutions used in the integration are printed to the command line by this function. Primarily useful for debugging purposes.
Definition at line 363 of file qucs_interface.cpp.
void trsolver_interface::rejectstep_async | ( | void | ) |
Definition at line 268 of file qucs_interface.cpp.
int trsolver_interface::setECVSVoltage | ( | char * | ecvsname, |
double | V | ||
) |
Sets the voltage of an exterally controlled voltage source.
ecvsname | The name of the voltage source to be set. |
V | New value of the voltage. |
This method searches for the ecvs component with the given name in ecvsname. If the ecvs exists, the value of the voltage to be set at the next time step is set to the supplied value in V.
You can set the voltage of ecvs components in subcircuits created by using a name up of the subcircuit heirarchy it is in, e.g. the name
SUBtop.SUBlower.ECVS1
to set the voltage of an ecvs named ECVS1 which is located in subcircuit SUBlower, which is itself in subcircuit SUBtop in the top level circuit.
Returns 0 if the ecvs was found, and -1 otherwise.
Definition at line 278 of file qucs_interface.cpp.
void trsolver_interface::setMessageFcn | ( | void(*)(int level, const char *format,...) | newmessagefcn | ) |
Sets pointer to function used to print messages during a sim.
printing | function to be used by e_trsolver |
The printing function can be replace with a function with signature
(*messagefcn)(int level, const char * format, ...);
By default this points to the standard Qucs logprint function (found in logging.c) on creation of an e_trsolver instance. The log level flag indicates whether the message is a status update or an error message. format contains the formatting string in the same style as printf (when using logprint). The additional arguments are used by logprint in the supplied formatting string.
Definition at line 368 of file qucs_interface.cpp.
int trsolver_interface::stepsolve_async | ( | double | steptime | ) |
Definition at line 257 of file qucs_interface.cpp.
int trsolver_interface::stepsolve_sync | ( | double | synctime | ) |
Definition at line 246 of file qucs_interface.cpp.
qucs::e_trsolver* qucs::trsolver_interface::etr [private] |
Pointer to etr sim.
Definition at line 236 of file qucs_interface.h.
bool qucs::trsolver_interface::isInitialised [private] |
Definition at line 234 of file qucs_interface.h.