[Pkg-electronics-commits] [gnucap] 41/47: transient-3: store (used by measure) and alarm use all time steps
felix salfelder
felix-guest at moszumanska.debian.org
Mon Sep 26 10:38:00 UTC 2016
This is an automated email from the git hooks/post-receive script.
felix-guest pushed a commit to branch master
in repository gnucap.
commit 48961cc7b429fab315dbbc2b112b1e3180e9393c
Author: al davis <ad211 at freeelectron.net>
Date: Fri Sep 23 03:52:56 2016 -0400
transient-3: store (used by measure) and alarm use all time steps
---
apps/s__out.cc | 31 +++++++++++++++++++++++--------
apps/s_ac.cc | 4 ++--
apps/s_dc.cc | 3 +--
apps/s_tr_swp.cc | 21 ++++++++++++---------
include/patchlev.h | 2 +-
include/s__.h | 10 ++++++++--
6 files changed, 47 insertions(+), 24 deletions(-)
diff --git a/apps/s__out.cc b/apps/s__out.cc
index 27ba585..9009f30 100644
--- a/apps/s__out.cc
+++ b/apps/s__out.cc
@@ -1,4 +1,4 @@
-/*$Id: s__out.cc,v 26.137 2010/04/10 02:37:05 al Exp $ -*- C++ -*-
+/*$Id: s__out.cc 2016/09/22 $ -*- C++ -*-
* Copyright (C) 2001 Albert Davis
* Author: Albert Davis <aldavis at gnu.org>
*
@@ -49,16 +49,31 @@ const PROBELIST& SIM::storelist()const
}
/*--------------------------------------------------------------------------*/
/* SIM::out: output the data, "keep" for ac reference
+ * x = the x coordinate
+ * print = selected points, "print" to screen, files, etc.
+ * store = all points, for internal postprocessing, measure
+ * keep = after the command is done, dcop for ac
*/
-void SIM::outdata(double x)
+void SIM::outdata(double x, int outflags)
{
::status.output.start();
- plottr(x, plotlist());
- print_results(x);
- alarm();
- store_results(x);
- _sim->reset_iteration_counter(iPRINTSTEP);
- ::status.hidden_steps = 0;
+ if (outflags & ofKEEP) {
+ _sim->keep_voltages();
+ }else{
+ }
+ if (outflags & ofPRINT) {
+ plottr(x, plotlist());
+ print_results(x);
+ _sim->reset_iteration_counter(iPRINTSTEP);
+ ::status.hidden_steps = 0;
+ }else{
+ ++::status.hidden_steps;
+ }
+ if (outflags & ofSTORE) {
+ alarm();
+ store_results(x);
+ }else{
+ }
::status.output.stop();
}
/*--------------------------------------------------------------------------*/
diff --git a/apps/s_ac.cc b/apps/s_ac.cc
index e8112c4..7dcf3de 100644
--- a/apps/s_ac.cc
+++ b/apps/s_ac.cc
@@ -1,4 +1,4 @@
-/*$Id: s_ac.cc 2016/09/11 al $ -*- C++ -*-
+/*$Id: s_ac.cc 2016/09/22 al $ -*- C++ -*-
* Copyright (C) 2001 Albert Davis
* Author: Albert Davis <aldavis at gnu.org>
*
@@ -254,7 +254,7 @@ void AC::sweep()
do {
_sim->_jomega = COMPLEX(0., _sim->_freq * M_TWO_PI);
solve();
- outdata(_sim->_freq);
+ outdata(_sim->_freq, ofPRINT | ofSTORE);
} while (next());
}
/*--------------------------------------------------------------------------*/
diff --git a/apps/s_dc.cc b/apps/s_dc.cc
index dd498f7..d327164 100644
--- a/apps/s_dc.cc
+++ b/apps/s_dc.cc
@@ -377,8 +377,7 @@ void DCOP::sweep_recursive(int Nest)
CARD_LIST::card_list.tr_accept();
::status.accept.stop();
_sim->_has_op = _sim->_mode;
- _sim->keep_voltages();
- outdata(*_sweepval[Nest]);
+ outdata(*_sweepval[Nest], ofPRINT | ofSTORE | ofKEEP);
itl = OPT::DCXFER;
}else{
sweep_recursive(Nest);
diff --git a/apps/s_tr_swp.cc b/apps/s_tr_swp.cc
index 3715910..c6ba78f 100644
--- a/apps/s_tr_swp.cc
+++ b/apps/s_tr_swp.cc
@@ -1,4 +1,4 @@
-/*$Id: s_tr_swp.cc 2016/09/21 al $ -*- C++ -*-
+/*$Id: s_tr_swp.cc 2016/09/22 al $ -*- C++ -*-
* Copyright (C) 2001 Albert Davis
* Author: Albert Davis <aldavis at gnu.org>
*
@@ -94,12 +94,13 @@ void TRANSIENT::sweep()
{
bool printnow = (_sim->_time0 == _tstart || _trace >= tALLTIME);
+ int outflags = ofNONE;
if (printnow) {
- _sim->keep_voltages();
- outdata(_sim->_time0);
+ outflags = ofPRINT | ofSTORE | ofKEEP;
}else{
- ++::status.hidden_steps;
+ //outflags = ofSTORE;
}
+ outdata(_sim->_time0, outflags);
}
while (next()) {
@@ -131,16 +132,18 @@ void TRANSIENT::sweep()
|| (_accepted && (_trace >= tALLTIME
|| step_cause() == scUSER
|| (!_tstrobe.has_hard_value() && _sim->_time0+_sim->_dtmin > _tstart)));
+ int outflags = ofNONE;
if (printnow) {
- _sim->keep_voltages();
- outdata(_sim->_time0);
- }else{
- ++::status.hidden_steps;
+ outflags = ofPRINT | ofSTORE | ofKEEP;
+ }else if (_accepted) {untested();
+ //outflags = ofSTORE;
+ }else{untested();
}
+ outdata(_sim->_time0, outflags);
}
if (!_converged && OPT::quitconvfail) {untested();
- outdata(_sim->_time0);
+ outdata(_sim->_time0, ofPRINT);
throw Exception("convergence failure, giving up");
}else{
}
diff --git a/include/patchlev.h b/include/patchlev.h
index ac3252c..15949ca 100644
--- a/include/patchlev.h
+++ b/include/patchlev.h
@@ -1 +1 @@
-#define PATCHLEVEL "transient-3 2016.09.22"
+#define PATCHLEVEL "transient-3 2016.09.23"
diff --git a/include/s__.h b/include/s__.h
index 4dab5a9..d03cc16 100644
--- a/include/s__.h
+++ b/include/s__.h
@@ -1,4 +1,4 @@
-/*$Id: s__.h,v 26.138 2013/04/24 02:32:27 al Exp $ -*- C++ -*-
+/*$Id: s__.h 2016/09/22 $ -*- C++ -*-
* Copyright (C) 2001 Albert Davis
* Author: Albert Davis <aldavis at gnu.org>
*
@@ -45,6 +45,12 @@ protected:
tITERATION = 4, /* show every iteration, including nonconverged */
tVERBOSE = 5 /* show extended diagnostics */
};
+ enum OUTFLAGS { // bit fields
+ ofNONE = 0,
+ ofPRINT = 1,
+ ofSTORE = 2,
+ ofKEEP = 4
+ };
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
CARD_LIST* _scope;
OMSTREAM _out; /* places to send the results */
@@ -73,7 +79,7 @@ protected:
const PROBELIST& plotlist()const;
const PROBELIST& printlist()const;
const PROBELIST& storelist()const;
- virtual void outdata(double);
+ virtual void outdata(double, int);
virtual void head(double,double,const std::string&);
virtual void print_results(double);
virtual void alarm();
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-electronics/gnucap.git
More information about the Pkg-electronics-commits
mailing list