spis.Surf.SurfDistrib
Class SurfDistrib

java.lang.Object
  extended byspis.Surf.SurfDistrib.SurfDistrib
Direct Known Subclasses:
MultipleSurfDistrib, NonPICSurfDistrib, PICSurfDistrib

public abstract class SurfDistrib
extends java.lang.Object

Class Name : SurfDistrib (generic Surface Distribution)
Project ref : SPIS project
File name : SurfDistrib.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 : generic abstract Surface Distribution.
A surface distribution f_s is indeed a "flux distribution", it is the volume distribution f_n multiplied by the velocity normal to the surface v.n:
f_s(x,v,t) = v.n f_v(x,v,t).
It stores the particle distribution at the desired accuracy level:
it can be a full velocity distribution function (PIC model) or only its moments (fluid approach)
All Surface Distribution classes must be derived from this class.

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
protected  VolDistrib from
          Volume distribution this surface distribution comes from (optioinal data, thus not requested in constructor)
protected  SurfMesh sm
          Surface Mesh on which the distribution "lives"
protected  VolDistrib to
          Volume distribution this surface distribution comes from (optioinal data, thus not requested in constructor)
 
Constructor Summary
SurfDistrib(SurfMesh surfMesh)
          constructor
 
Method Summary
abstract  float assesMinTimeToCrossOneCell()
          Assesses the minimum time to cross one cell when particles are injected from this surface distribution into volume.
protected  void checkMomentConsistentWithOrder(SurfField mom, int order)
          Checks the moment sub-type (ScalSurfField or VectSurfField) is consistent with the moment order.
 VolDistrib getFrom()
           
 void getMoment(SurfField mom, int order)
          charge, mass, time, normalised and deviation flags omitted: they are set to their default value, 0
 void getMoment(SurfField mom, int order, int charge)
          mass, time, normalised and deviation flags omitted: they are set to their default value, 0
 void getMoment(SurfField mom, int order, int charge, int mass)
          time, normalised and deviation flags omitted: they are set to their default value, 0
abstract  void getMoment(SurfField mom, int order, int charge, int mass, int time)
          normalised and deviation flags omitted: they are set to their default value, 0
 void getMoment(SurfField mom, int order, int charge, int mass, int time, int normalised)
          deviation flag omitted: it is set to its default value, 0
 void getMoment(SurfField mom, int order, int charge, int mass, int time, int normalised, int deviation)
          Provides the moments of the distribution (order=0 => number current, 1 => momentum current, 2 => energy current...).
abstract  PartList getSample(float dt)
          Returns a sample of the surface distribution (a flux indeed) integrated over the time dt.
 SurfMesh getSm()
          Provides a pointer to the surface mesh this distribution lives on
 VolDistrib getTo()
           
abstract  void map(SurfDistrib sd)
          Maps the SurfDistrib passed, sd, into this SurfDistrib.
abstract  void sample(PartList pl, float dt)
          Computes a sample of the surface distribution (a flux indeed) integrated over the time dt.
 void setFrom(VolDistrib fromDistrib)
           
 void setTo(VolDistrib toDistrib)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

sm

protected SurfMesh sm
Surface Mesh on which the distribution "lives"


from

protected VolDistrib from
Volume distribution this surface distribution comes from (optioinal data, thus not requested in constructor)


to

protected VolDistrib to
Volume distribution this surface distribution comes from (optioinal data, thus not requested in constructor)

Constructor Detail

SurfDistrib

public SurfDistrib(SurfMesh surfMesh)
constructor

Parameters:
surfMesh -
Method Detail

getMoment

public void getMoment(SurfField mom,
                      int order,
                      int charge,
                      int mass,
                      int time,
                      int normalised,
                      int deviation)
Provides the moments of the distribution (order=0 => number current, 1 => momentum current, 2 => energy current...).
Depending on the class specialisation the moment is obtained directly or by averaging over particles.
Parameters are (last parameters can be omitted with default 0, cf. other routine interfaces):
- order: moment order (0 -> number flux, 1 -> velocity flux...)
- charge: if 1, multiplies by particle charge (if 0 does not) [ecu]
- mass: if 1, multiplies by particle mass (if 0 does not) [amu]
- time: if 1, multiplies by (integration) time, which gives cumulated amounts, not rates (supported by PICSurfDistrib only) [s]
- normalised: if 1, normalises by number flux (order 0 moment with all zero parameters)
- deviation: if 1, substracts average velocity from microscopic velocities (relevant for order 2 or more only)
Exemples:
- getMoment(ScalSurfField mom, 0, 0, 0, 0, 0, 0): particle number flux [#/el]
- getMoment(ScalSurfField mom, 0, 1, 0, 0, 0, 0): charge flux [ecu/el]
- getMoment(VectSurfField mom, 1, 0, 1, 0, 0, 0): momentum flux
- getMoment(ScalSurfField mom, 2, 0, 1, 0, 0, 0): 2 * kinetic energy flux
- getMoment(ScalSurfField mom, 0, 1, 0, 1, 0, 0): cumulated deposited charge
- getMoment(ScalSurfField mom, 2, 0, 1, 0, 1, 0): 2 * average kinetic energy
- getMoment(ScalSurfField mom, 2, 0, 1, 0, 1, 1): 2 * average kinetic energy in centre-of-mass frame, i.e. ~ kB*Temperature
NB: for order 2 moments, since no tensorial fields of order 2 exist for now (would-be-TensorSurfField), the self-contracted tensor is provided.

Parameters:
mom -
order -
charge -
mass -
time -
normalised -
deviation -

getMoment

public void getMoment(SurfField mom,
                      int order,
                      int charge,
                      int mass,
                      int time,
                      int normalised)
deviation flag omitted: it is set to its default value, 0

Parameters:
mom -
order -
charge -
mass -
time -
normalised -
See Also:
getMoment(SurfField, int, int, int, int, int, int)

getMoment

public abstract void getMoment(SurfField mom,
                               int order,
                               int charge,
                               int mass,
                               int time)
normalised and deviation flags omitted: they are set to their default value, 0

Parameters:
mom -
order -
charge -
mass -
time -
See Also:
getMoment(SurfField, int, int, int, int, int, int)

getMoment

public void getMoment(SurfField mom,
                      int order,
                      int charge,
                      int mass)
time, normalised and deviation flags omitted: they are set to their default value, 0

Parameters:
mom -
order -
charge -
mass -
See Also:
getMoment(SurfField, int, int, int, int, int, int)

getMoment

public void getMoment(SurfField mom,
                      int order,
                      int charge)
mass, time, normalised and deviation flags omitted: they are set to their default value, 0

Parameters:
mom -
order -
charge -
See Also:
getMoment(SurfField, int, int, int, int, int, int)

getMoment

public void getMoment(SurfField mom,
                      int order)
charge, mass, time, normalised and deviation flags omitted: they are set to their default value, 0

Parameters:
mom -
order -
See Also:
getMoment(SurfField, int, int, int, int, int, int)

sample

public abstract void sample(PartList pl,
                            float dt)
Computes a sample of the surface distribution (a flux indeed) integrated over the time dt.
Depending on the class specialisation the sample is either obtained directly (or by extraction of a part of a particle list) or by an actual sampling of a distribution described by its moments.
In some versions, parameters may be need to control the sampling.
The subtype of the generated list is fixed by the passed variable pl, contrarily to the getSample method, which returns a Partlist (or dynamically a RichPartList...).

See Also:
getSample(float)

getSample

public abstract PartList getSample(float dt)
Returns a sample of the surface distribution (a flux indeed) integrated over the time dt.
For a PIC distribution, it is direct, or at maximum an extraction of a fraction of pl (dt/time), although a re-sampling may be needed.
The subtype of the returned generated list is free here, contrarily to the sample method, where it is fixed by the passed variable pl.

See Also:
sample(PartList, float)

map

public abstract void map(SurfDistrib sd)
Maps the SurfDistrib passed, sd, into this SurfDistrib.
Performs the best mapping possible: from a PIC distribution (sd) to a fluid distribution (this) it will compute moments, from fluid to PIC it will perform a sampling...
Richer interfaces may also be implemented in derived classes (to tune sampling...)


assesMinTimeToCrossOneCell

public abstract float assesMinTimeToCrossOneCell()
Assesses the minimum time to cross one cell when particles are injected from this surface distribution into volume.
The minimum is to be taken over mesh elements, whereas rather an average value must be used among the velocity distribution.
This is used by volume distributions (PIC today, maybe fluid later) to assess the largest possible integration time, so if this minTimeToCrossOneCell cannot be evaluated (e.g. a generic PICSurfDistrib), it should return + infinity (e.g. 1.E20).

Returns:
the minimum time to cross one cell

checkMomentConsistentWithOrder

protected void checkMomentConsistentWithOrder(SurfField mom,
                                              int order)
Checks the moment sub-type (ScalSurfField or VectSurfField) is consistent with the moment order. Also checked that the moment field is surface-centred

Parameters:
mom - moment
order - moment order

getSm

public SurfMesh getSm()
Provides a pointer to the surface mesh this distribution lives on


getFrom

public VolDistrib getFrom()
Returns:
the volume distribution this flux comes from

getTo

public VolDistrib getTo()
Returns:
the volume distribution this flux has to be directed to

setFrom

public void setFrom(VolDistrib fromDistrib)
Parameters:
fromDistrib - the volume distribution this flux comes from

setTo

public void setTo(VolDistrib toDistrib)
Parameters:
toDistrib - the volume distribution this flux has to be directed to