spis.Util.Monitor
Class ElecSuperNodeMonitor

java.lang.Object
  extended byspis.Util.Monitor.ElecSuperNodeMonitor

public class ElecSuperNodeMonitor
extends java.lang.Object

Class Name : ElecSuperNodeMonitor
Project ref : SPIS project
File name : ElecSuperNodeMonitor.java
File type : class
Copyright : ONERA, 2 Av. E. Belin, 31055 Toulouse cedex, France http://www.onecert.fr
Status : under development
Creation : 17 nov. 2004
Modification :

Description : Monitors data on electric super nodes: potentials and currents.

They are stored with predefined time steps. The monitor method must be invoked more often than the time steps, and the storage is done only if needed.
Currents (not potentials) are averaged over the time frame between each storage, it is this advised to call monitor(...) anytime a new current has been computed to get the best statistics.
These data are directed to:
- XyData time plots, to be retrieved by getResults() for post procesing
- Output files: potentials.txt, emittedCurrents.txt, collectedCurrents.txt (need to be manually closes at the end with closeOutputFiles())
- screen: only sums
NB: modifications by user is easy and encouraged: reduce the number of outputs if too many, average potentials if noisy also, etc.

Versions and anomalies correction :

Version numberAuthor (name, e-mail) Corrections/Modifications
0.1 JF Roussel, roussel@onecert.frCreation


Version:
0.1
Author:
JF Roussel

Field Summary
private  XyData[][] colCur
          collected currents versus time (the data) Dimension: [populationNb+1][superNodeNb+1], colCurSum[i][j] deals with population i-1, super node j-1, and the sum if i=0 or j=0
private  float[][] colCurSum
          collected currents summation variable (between two storages, for time smoothing) Dimension: [populationNb+1][superNodeNb+1], colCurSum[i][j] deals with population i-1, super node j-1, and the sum if i=0 or j=0
private  int colCurSumNb
          number of sums performed for collected currents
private  java.io.FileWriter colCurWriter
          FileWriter for collected currents
private  ScalSurfField curBuf
          current buffer: a surface-centred surface field on the sc mesh
private  XyData[][] emCur
          emitted currents versus time (the data) Dimension: [interactorNb+1][superNodeNb+1], emCurSum[i][j] deals with interactor i-1, super node j-1, and the sum if i=0 or j=0
private  float[][] emCurSum
          emitted currents summation variable (between two storages, for time smoothing).
private  int emCurSumNb
          number of sums performed for emitted currents
private  java.io.FileWriter emCurWriter
          FileWriter for emitted currents
private  float esnMonitorStep
          time step for electric super node data monitoring
private  boolean filePrinting
          if true, data will be printed to files (may get inactive due to an IO error)
private  int interactorNb
          number of interactors (hence of potential particle sources )
private  float lastColCurStorage
          last storage of collected currents
private  float lastEmCurStorage
          last storage of emitted currents
private  float lastPotStorage
          last potential storage
private  MmfPlasma plasma
          plasma model (might be a generic plasma later, for now an MmfPlasma)
private  int populationNb
          number of particle populations
private  XyData[] pot
          SC potentials versus time (the data)
private  java.io.FileWriter potWriter
          FileWriter for potentials
private  java.util.Vector results
          results of monitoring
private  RCCabsSC sc
          spacecraft model (might be a generic SC later, for now an RCCabsSC)
private  int superNodeNb
          number of electric super nodes
 
Constructor Summary
ElecSuperNodeMonitor(MmfPlasma plasma, RCCabsSC sc, float esnMonitorStep)
          Default constructor
 
Method Summary
 void closeOutputFiles()
          Close monitoring output files: potentials.txt, emittedCurrents.txt, collectedCurrents.txt
 java.util.Vector getResults()
           
private  void init()
           
 void monitor(float t, SurfDistrib[] collectedCurrents, SurfDistrib[] emittedCurrents)
          Stores extra data at time t for monitoring if needed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

sc

private RCCabsSC sc
spacecraft model (might be a generic SC later, for now an RCCabsSC)


plasma

private MmfPlasma plasma
plasma model (might be a generic plasma later, for now an MmfPlasma)


superNodeNb

private int superNodeNb
number of electric super nodes


populationNb

private int populationNb
number of particle populations


interactorNb

private int interactorNb
number of interactors (hence of potential particle sources )


esnMonitorStep

private float esnMonitorStep
time step for electric super node data monitoring


lastPotStorage

private float lastPotStorage
last potential storage


lastColCurStorage

private float lastColCurStorage
last storage of collected currents


lastEmCurStorage

private float lastEmCurStorage
last storage of emitted currents


filePrinting

private boolean filePrinting
if true, data will be printed to files (may get inactive due to an IO error)


potWriter

private java.io.FileWriter potWriter
FileWriter for potentials


colCurWriter

private java.io.FileWriter colCurWriter
FileWriter for collected currents


emCurWriter

private java.io.FileWriter emCurWriter
FileWriter for emitted currents


pot

private XyData[] pot
SC potentials versus time (the data)


colCur

private XyData[][] colCur
collected currents versus time (the data) Dimension: [populationNb+1][superNodeNb+1], colCurSum[i][j] deals with population i-1, super node j-1, and the sum if i=0 or j=0


emCur

private XyData[][] emCur
emitted currents versus time (the data) Dimension: [interactorNb+1][superNodeNb+1], emCurSum[i][j] deals with interactor i-1, super node j-1, and the sum if i=0 or j=0


results

private java.util.Vector results
results of monitoring


curBuf

private ScalSurfField curBuf
current buffer: a surface-centred surface field on the sc mesh


colCurSum

private float[][] colCurSum
collected currents summation variable (between two storages, for time smoothing) Dimension: [populationNb+1][superNodeNb+1], colCurSum[i][j] deals with population i-1, super node j-1, and the sum if i=0 or j=0


colCurSumNb

private int colCurSumNb
number of sums performed for collected currents


emCurSum

private float[][] emCurSum
emitted currents summation variable (between two storages, for time smoothing). Dimension: [interactorNb+1][superNodeNb+1], emCurSum[i][j] deals with interactor i-1, super node j-1, and the sum if i=0 or j=0


emCurSumNb

private int emCurSumNb
number of sums performed for emitted currents

Constructor Detail

ElecSuperNodeMonitor

public ElecSuperNodeMonitor(MmfPlasma plasma,
                            RCCabsSC sc,
                            float esnMonitorStep)
Default constructor

Parameters:
plasma -
sc -
esnMonitorStep -
Method Detail

init

private void init()

monitor

public void monitor(float t,
                    SurfDistrib[] collectedCurrents,
                    SurfDistrib[] emittedCurrents)
Stores extra data at time t for monitoring if needed.
Currents are to be passed to this method because they are not stored in permanent objects (SC) passed to this monitor constructor (contrarily to potentials)

Parameters:
t -
collectedCurrents - If null no storage
emittedCurrents - If null no storage

getResults

public java.util.Vector getResults()
Returns:
Returns the results of the monitoring (potentials and currents on/from super nodes versus time)

closeOutputFiles

public void closeOutputFiles()
Close monitoring output files: potentials.txt, emittedCurrents.txt, collectedCurrents.txt