spis.Top.Simulation
Class Simulation

java.lang.Object
  extended byspis.Top.Simulation.Simulation
Direct Known Subclasses:
PlasmaScSimulation

public abstract class Simulation
extends java.lang.Object

Class Name : Simulation (generic Simulation class)
Project ref : SPIS project
File name : Simulation.java
File type : class
Copyright : ONERA, 2 Av. E. Belin, 31055 Toulouse cedex, France http://www.onecert.fr
Status : under development
Creation : 25/08/2003
Modification :

Description : general abstract Simulation class.
The top level simulation level. It computes the dynamics due to the coupling of the spacecraft and plasma dynamics.
All Simulation classes must be derived from this class. The abstract methods defined here must be implemented in the derived classes.
This class simply enforces the minimum data transfer to allow proper interfacing with SPIS framework:
- inputs (in constructor): volume mesh, two surface meshes (external boundary and spacecraft, internally)
- ouputs (abstract getXXX() routines): results as volume/surface maps, particle trajectories, time varying scalar (for x(t) plots), or tyme varying curves (for (y(x))(t) plots, or possibly(y,x)(t)).
NB: The volume/surface meshes are left of the generic VolMesh/SurfMesh types, but only 3D unstructured versions of the meshes, ThreeDUnstructVolMesh and ThreeDUnstructSurfMesh, can indeed currently be handled by the solvers and the framework (this is why the only derived class of this one, PlasmaScSimulation, stores the meshes with their sub-types). When solvers for other types of meshes are developed, this class will still be valid, and new simulation classes will have to be derived from it.

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  SurfMesh bdSurfMesh
          the 3D untructured surface mesh, external boundary of the simulation box (not a physical surface)
private  GlobalParameter[] globalParameters
          Global parameters (plasma density...)
protected  java.util.Vector results
          data to be stored for post-processing
private  SurfMesh scSurfMesh
          the 3D untructured spacecraft surface mesh, (a physical surface)
private  VolMesh volMesh
          the 3D untructured volume mesh, of the simulation box
 
Constructor Summary
protected Simulation()
          temporary constructor without meshes, to allow to build this from the framework without meshes
  Simulation(VolMesh volMesh_, SurfMesh bdSurfMesh_, SurfMesh scSurfMesh_)
          Default constructor with volume and surface meshes.
  Simulation(VolMesh volMesh_, SurfMesh bdSurfMesh_, SurfMesh scSurfMesh_, GlobalParameter[] globalParameters_)
          Constructor with volume and surface meshes, and global parameters.
 
Method Summary
 void exportUIData()
          exports meshes and other data from user interface
 SurfMesh getBdSurfMesh()
           
 SurfField[] getBdSurfResults()
          Returns data on the external boundary surface resulting of the computation, typically potential and current surface maps.
abstract  XyzData[] getCurveTimePlots()
          Returns x-y-z data resulting of the computation, typically curves at successive computation times, e.g. an RPA I(V) curve at different simulation times (x is time, y is V, z is I, which shall allow to generate I(V) plots in the framework).
 GlobalParameter[] getGlobalParameters()
           
 java.util.Vector getResults()
           
 XyData[] getScalTimePlots()
          Returns x-y data resulting of the computation, typically time plots a physical value (potential... cf myXyData.getName()).
 SurfMesh getScSurfMesh()
           
 SurfField[] getScSurfResults()
          Returns data on spacecraft surface resulting of the computation, typically potential and current surface maps.
abstract  Trajectory[] getTrajectories()
          Returns particle trajectories compited in the simulation.
 VolMesh getVolMesh()
           
 VolField[] getVolResults()
          Returns volume data resulting of the computation, typically potential and density volume maps.
 void importUIData()
          imports meshes and other data from user interface
abstract  void integrate(float t)
          Time integration of the coupled plasma-spacecraft dynamics over the time t.
protected  int selectResults(java.lang.Object[] specificData, int ctr, java.lang.Class selectedClass)
          Adds results (post-processing data) of the type selectedClass to the array specificData, starting at the index ctr of the passed array specific data (it must have been dimensioned to a sufficient size before the call, use results.size()).
 void setBdSurfMesh(SurfMesh mesh)
           
 void setDefaultInputPath(java.lang.String inPath)
          Sets the default input path, used for file reading.
 void setDefaultOutputPath(java.lang.String outPath)
          Sets the default output path, used for file writing.
 void setDefaultPaths(java.lang.String outPath, java.lang.String inPath)
          Sets the default paths (used for file reading/writing)
 void setGlobalParameters(GlobalParameter[] parameters)
          Defines the global parameters for this simulation
 void setResults(java.util.Vector vector)
           
 void setScSurfMesh(SurfMesh mesh)
           
 void setVolMesh(VolMesh mesh)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

volMesh

private VolMesh volMesh
the 3D untructured volume mesh, of the simulation box


bdSurfMesh

private SurfMesh bdSurfMesh
the 3D untructured surface mesh, external boundary of the simulation box (not a physical surface)


scSurfMesh

private SurfMesh scSurfMesh
the 3D untructured spacecraft surface mesh, (a physical surface)


globalParameters

private GlobalParameter[] globalParameters
Global parameters (plasma density...) stored here to be used by sub-objects


results

protected java.util.Vector results
data to be stored for post-processing

Constructor Detail

Simulation

public Simulation(VolMesh volMesh_,
                  SurfMesh bdSurfMesh_,
                  SurfMesh scSurfMesh_)
Default constructor with volume and surface meshes.

Parameters:
volMesh_ - volume mesh
bdSurfMesh_ - external boundary surface mesh
scSurfMesh_ - spacecraft surface mesh (also "internal" boundary of the volume mesh)

Simulation

public Simulation(VolMesh volMesh_,
                  SurfMesh bdSurfMesh_,
                  SurfMesh scSurfMesh_,
                  GlobalParameter[] globalParameters_)
Constructor with volume and surface meshes, and global parameters.

Parameters:
volMesh_ - volume mesh
bdSurfMesh_ - external boundary surface mesh
scSurfMesh_ - spacecraft surface mesh (also "internal" boundary of the volume mesh)

Simulation

protected Simulation()
temporary constructor without meshes, to allow to build this from the framework without meshes

Method Detail

getVolResults

public VolField[] getVolResults()
Returns volume data resulting of the computation, typically potential and density volume maps.
These choice of results to return, including the choice of possible intermediate data is done by the derived Simulation classes.
The VolField can be of any derived type, the main ones being ScalVolField and VectVolField.
They can also have variable centring (on nodes/volumes...)
The VolField data are self-contained, with in particular the following information:
- pointing to the volume mesh: volField.getVm() (but returns the only volume mesh existing the simulation => little interest)
- centring: volField.getCentring().getAbsDim() returns 0 for nodes, 1 for edges, 2 for surfaces, 3 for volume cells
- name of the data: volField.getName()
- time of data storage: volField.getTime()


getScSurfResults

public SurfField[] getScSurfResults()
Returns data on spacecraft surface resulting of the computation, typically potential and current surface maps.
These choice of results to return, including the choice of possible intermediate data is done by the derived Simulation classes.
The SurfField can be of any derived type, the main ones being ScalSurfField and VectSurfField.
They can also have variable centring (on nodes/surfaces...)
The SurfField data are self-contained, with in particular the following information:
- pointing to the surface mesh: surfField.getVm() (but returns the spacecraft surface mesh passed from UI to NUM => not really needed)
- centring: surfField.getCentring().getAbsDim() returns 0 for nodes, 1 for edges, 2 for surfaces
- name of the data: surfField.getName()
- time of data storage: surfField.getTime()


getBdSurfResults

public SurfField[] getBdSurfResults()
Returns data on the external boundary surface resulting of the computation, typically potential and current surface maps.
These choice of results to return, including the choice of possible intermediate data is done by the derived Simulation classes.
The SurfField can be of any derived type, the main ones being ScalSurfField and VectSurfField.
They can also have variable centring (on nodes/surfaces...)
The SurfField data are self-contained, with in particular the following information:
- pointing to the surface mesh: surfField.getVm() (but returns the boundary surface mesh passed from UI to NUM => not really needed)
- centring: surfField.getCentring().getAbsDim() returns 0 for nodes, 1 for edges, 2 for surfaces
- name of the data: surfField.getName()
- time of data storage: surfField.getTime()


getTrajectories

public abstract Trajectory[] getTrajectories()
Returns particle trajectories compited in the simulation.
These choice of results to return, including the choice of possible intermediate data is done by the derived Simulation classes.
See Trajectory class to get trajectory positions, etc.

See Also:
Trajectory

getScalTimePlots

public XyData[] getScalTimePlots()
Returns x-y data resulting of the computation, typically time plots a physical value (potential... cf myXyData.getName()).
These choice of results to return, including the choice of possible intermediate data is done by the derived Simulation classes.
XyData are self contained and data name, number and arrays can be extracted (see XyData class).

See Also:
XyData

getCurveTimePlots

public abstract XyzData[] getCurveTimePlots()
Returns x-y-z data resulting of the computation, typically curves at successive computation times, e.g. an RPA I(V) curve at different simulation times (x is time, y is V, z is I, which shall allow to generate I(V) plots in the framework).
These choice of results to return, including the choice of possible intermediate data is done by the derived Simulation classes.
XyData are self contained and data name, number and arrays can be extracted (see XyData class).

See Also:
XyData

integrate

public abstract void integrate(float t)
Time integration of the coupled plasma-spacecraft dynamics over the time t.
The results of this time evolution are the update of the plasma and spacecraft state variables (defined in the derived classes). It basically consists in an iteration of calls to the plasma dynamics and spacecraft potential update. Several different versions will be developed in derived classes.


exportUIData

public void exportUIData()
exports meshes and other data from user interface


importUIData

public void importUIData()
imports meshes and other data from user interface


selectResults

protected int selectResults(java.lang.Object[] specificData,
                            int ctr,
                            java.lang.Class selectedClass)
Adds results (post-processing data) of the type selectedClass to the array specificData, starting at the index ctr of the passed array specific data (it must have been dimensioned to a sufficient size before the call, use results.size()).

Parameters:
specificData -
ctr -
selectedClass -
Returns:
the index of the next available slot in the array specificData (i.e. its filled size)

setDefaultOutputPath

public void setDefaultOutputPath(java.lang.String outPath)
Sets the default output path, used for file writing.

Parameters:
outPath -

setDefaultInputPath

public void setDefaultInputPath(java.lang.String inPath)
Sets the default input path, used for file reading.

Parameters:
inPath -

setDefaultPaths

public void setDefaultPaths(java.lang.String outPath,
                            java.lang.String inPath)
Sets the default paths (used for file reading/writing)

Parameters:
outPath -
inPath -

getBdSurfMesh

public SurfMesh getBdSurfMesh()
Returns:

getResults

public java.util.Vector getResults()
Returns:

getScSurfMesh

public SurfMesh getScSurfMesh()
Returns:

getVolMesh

public VolMesh getVolMesh()
Returns:

setBdSurfMesh

public void setBdSurfMesh(SurfMesh mesh)
Parameters:
mesh -

setResults

public void setResults(java.util.Vector vector)
Parameters:
vector -

setScSurfMesh

public void setScSurfMesh(SurfMesh mesh)
Parameters:
mesh -

setVolMesh

public void setVolMesh(VolMesh mesh)
Parameters:
mesh -

getGlobalParameters

public GlobalParameter[] getGlobalParameters()
Returns:

setGlobalParameters

public void setGlobalParameters(GlobalParameter[] parameters)
Defines the global parameters for this simulation

Parameters:
parameters -