00001 #ifndef BRANCH_EQUATION_HH
00002 #define BRANCH_EQUATION_HH
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #include <stdarg.h>
00017 #include "tyvis/Component.hh"
00018 #include "tyvis/vhdl_ams.hh"
00019 #include "tyvis/Quantity.hh"
00020 #include "tyvis/VHDLType.hh"
00021 #include "tyvis/AMSType.hh"
00022 #include "tyvis/adouble.h"
00023 #include "tyvis/adutils.h"
00024
00025 class _savant_entity_ams_elab;
00026 class component;
00027 class AMSType;
00028
00036 class branchEquation : public component {
00037
00038 public:
00040 branchEquation();
00041
00043 virtual ~branchEquation();
00044
00052 branchEquation(const char* name, adouble (*functionPtr) (component *, adouble*),
00053 int noOfVariables, VHDLType **Qty);
00054
00065 branchEquation(_savant_entity_ams_elab *designPtr, component **&parent_equation, int caseValue, const char* name,
00066 adouble (*functionPtr) (component *, adouble*),int noOfVariables, ...);
00067
00069 virtual void init();
00070
00072 virtual bool getConsCheck();
00073
00075 virtual void setBranch();
00076
00078 virtual void definePointers();
00079
00086 virtual int findBranch(int posNode, int negNode);
00087
00089 virtual eqnType getEquationType();
00090
00092 virtual Quantity** getQuantities();
00093
00095 virtual int getNumberOfQuantities();
00096
00104 virtual int checkCurrent(int posNode, int negNode, int index);
00105
00107 virtual int load();
00108
00110 virtual int pointerAllocation();
00111
00113 virtual void add(component *comp);
00114
00121 int loadImplicitEqns(Quantity* qty);
00122
00125 int loadImplicitEqns();
00126
00129 virtual component* getImplicitEquationList(void);
00130
00132 void initializeImplicitEqns();
00133
00135 int pointerAllocationForImplicitEqns();
00136
00137
00138 protected:
00139
00140 private:
00142 int numberOfQuantities;
00143
00145 component *implicitEquationList;
00146
00148 bool conservativeCheck;
00149
00151 adouble (*functionPointer) (component *, adouble*);
00152
00154 spREAL **dcMatrixPointers;
00155
00157 spREAL **transientMatrixPointers;
00158
00160 int matrixCount;
00161
00163 int* base;
00164
00166 int* correctValue;
00167
00169 Quantity** branchQty;
00170
00172 int branch;
00173
00175 int sourceCurrent;
00176
00177 };
00178
00179 #endif
00180