spis.Util.List
Class RichPartList

java.lang.Object
  extended byspis.Util.List.PointList
      extended byspis.Util.List.PartList
          extended byspis.Util.List.RichPartList

public class RichPartList
extends PartList

Class Name : RichPartList
Project ref : SPIS project
File name : RichPartList.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 : List particles with enriched description
PointList class is extended (by derivation) to have a richer descrition of particles:
particle weight and type are added to allow variable weight (number of real particles represented) and type (mass, charge...) in the same list.

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  PartTable partTable
          table of particle types (often defined as SpisDefaultPartTypes.partTable
protected  IntScalTable partTypeIdT
          table of particle type index (values are indices in the particle types partTable)
protected  FloatScalTable weightT
          particle weight table (number of real particles in a superparticle)
 
Fields inherited from class spis.Util.List.PartList
flagT, isEmpty, isInVol, isNotInVol, isOccupied, isOnSurf1, isOnSurf2, part, setEmpty, setInVol, setOnSurf1, setOnSurf2, sm1, sm2, veloT, weight
 
Fields inherited from class spis.Util.List.PointList
dim, endId, indexT, posT, startId, vm
 
Constructor Summary
RichPartList(RichPartList rpl)
          copy constructor (variable arrays are copied, whereas for meshes and particle type table pointers only are copied)
RichPartList(VolMesh vm)
          Constructor with minimal data: builds a list with 0 particles and default particle types
RichPartList(VolMesh vm, SurfMesh bdSurfMesh, SurfMesh scSurfMesh, PartTable partTable_)
          Default constructor: builds a list with 0 particles
RichPartList(VolMesh vm, SurfMesh bdSurfMesh, SurfMesh scSurfMesh, PartTable partTable_, int dim)
          Constructor of a list of a given dimension
RichPartList(VolMesh vm, SurfMesh bdSurfMesh, SurfMesh scSurfMesh, PartTable partTable_, IntScalTable flagT, SpaceVectTable posT, IntScalTable indexT, VeloVectTable veloT, IntScalTable partTypeIdT_, FloatScalTable weightT_)
          Constructor with full data
RichPartList(VolMesh vm, SurfMesh bdSurfMesh, SurfMesh scSurfMesh, PartTable partTable_, VolSampler sampler, int partType)
          Constructor of a sampled list
 
Method Summary
 void clean(TestOfInt selectPart, IntScalTable selectTable)
          Cleans the list, excluding particles verifying selectPart.test(selectTable[i])
 void computeChargeOverMass(FloatScalTable chargeOverMass)
           
 void concat(PartList plIn)
          concatenates the provided list plIn to this list.
 void extract(PartList plOut, TestOfInt extractTest)
          Extracts the particles of this list fullfilling the condition extractTest.test(flag) to the other list plOut.
 PartList extractFraction(float ratio)
          extracts a fraction of the list (at random)
 void generateSurfaceSample(SurfMesh sm, SurfSampler sampler, float time)
          generates a sample of particles following the passed sampler for velocities, and uniformely on surface mesh for positions.
 void generateVolumeSample(VolSampler sampler)
          generates a sample of particles following the passed sampler for velocities, and uniformely in volume mesh for positions.
 float[] getChargeArray()
          Returns the array of the charges of each particle type (array index = particle type)
 float[] getChargeOverMassArray()
          Returns the array of the q/m ratios of each particle type (array index = particle type)
 float[] getMassArray()
          Returns the array of the masses of each particle type (array index = particle type)
 PartList getPartListCopy()
          returns a copy of this list (to be overriden by sub-types)
 PartTable getPartTable()
           
 IntScalTable getPartTypeIdTable()
          returns the table of particle types
 PartList getSimilar()
          returns a similar PartList, with same subtype and particle type(s) (and fixed weight), but empty (to be overriden by sub-types (derived classes)
 FloatScalTable getWeightTable()
          returns the table of particle weights (number of real particles in a superparticle)
 void init(int dim, PartTable partTable_)
          Initialisations
 void inject(PartList plIn)
          injects the provided list plIn into this list.
 void setDim(int dimension)
          sets the list dimension to dim: resizes the tables if needed, not preserving data (except if no resizing is needed).
 void setDimPreserve(int dimension)
          sets the list dimension to dim: resizes the tables if needed preserving data
 
Methods inherited from class spis.Util.List.PartList
applyFunc, applyFuncDeprecated, applyFuncDeprecated, applyFuncDeprecated, applyFuncDeprecated, getFlagTable, getIsOnThisSurfMesh, getPart, getSm1, getSm2, getVeloTable, getWeight, init, initBuffers
 
Methods inherited from class spis.Util.List.PointList
declareDim, getDim, getEndId, getIndexTable, getPosTable, getStartId, getVm, init
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

weightT

protected FloatScalTable weightT
particle weight table (number of real particles in a superparticle)


partTypeIdT

protected IntScalTable partTypeIdT
table of particle type index (values are indices in the particle types partTable)


partTable

protected PartTable partTable
table of particle types (often defined as SpisDefaultPartTypes.partTable

Constructor Detail

RichPartList

public RichPartList(VolMesh vm,
                    SurfMesh bdSurfMesh,
                    SurfMesh scSurfMesh,
                    PartTable partTable_)
Default constructor: builds a list with 0 particles

Parameters:
vm - reference volume mesh of the list
bdSurfMesh - boundary surface mesh (No 1)
scSurfMesh - spacecraft surface mesh (No 2)
partTable_ - particle table

RichPartList

public RichPartList(VolMesh vm,
                    SurfMesh bdSurfMesh,
                    SurfMesh scSurfMesh,
                    PartTable partTable_,
                    int dim)
Constructor of a list of a given dimension

Parameters:
vm - reference volume mesh of the list
bdSurfMesh - boundary surface mesh (No 1)
scSurfMesh - spacecraft surface mesh (No 2)
partTable_ - particle table
dim - dimension of the tables to be allocated

RichPartList

public RichPartList(VolMesh vm,
                    SurfMesh bdSurfMesh,
                    SurfMesh scSurfMesh,
                    PartTable partTable_,
                    VolSampler sampler,
                    int partType)
Constructor of a sampled list

Parameters:
vm - reference volume mesh of the list
bdSurfMesh - boundary surface mesh (No 1)
scSurfMesh - spacecraft surface mesh (No 2)
partTable_ - particle table
sampler - particle random generator

RichPartList

public RichPartList(VolMesh vm)
Constructor with minimal data: builds a list with 0 particles and default particle types

Parameters:
vm - reference volume mesh of the list (surface are extracted from this volume mesh)

RichPartList

public RichPartList(VolMesh vm,
                    SurfMesh bdSurfMesh,
                    SurfMesh scSurfMesh,
                    PartTable partTable_,
                    IntScalTable flagT,
                    SpaceVectTable posT,
                    IntScalTable indexT,
                    VeloVectTable veloT,
                    IntScalTable partTypeIdT_,
                    FloatScalTable weightT_)
Constructor with full data

Parameters:
vm - reference volume mesh of the list
bdSurfMesh - boundary surface mesh (No 1)
scSurfMesh - spacecraft surface mesh (No 2)
partTable_ - particle table
flagT - flag table
posT - position table
indexT - index table
veloT - velocity table
partTypeIdT_ - particle type table
weightT_ - weight table

RichPartList

public RichPartList(RichPartList rpl)
copy constructor (variable arrays are copied, whereas for meshes and particle type table pointers only are copied)

Parameters:
rpl - list to be copied
Method Detail

init

public void init(int dim,
                 PartTable partTable_)
Initialisations

Parameters:
dim - number of particle => dimension of the tables to create

generateVolumeSample

public void generateVolumeSample(VolSampler sampler)
generates a sample of particles following the passed sampler for velocities, and uniformely in volume mesh for positions.

Overrides:
generateVolumeSample in class PartList

generateSurfaceSample

public void generateSurfaceSample(SurfMesh sm,
                                  SurfSampler sampler,
                                  float time)
generates a sample of particles following the passed sampler for velocities, and uniformely on surface mesh for positions.

Overrides:
generateSurfaceSample in class PartList
Parameters:
sm - surface mesh the smapling has to done on
sampler - surface sampler => generates random velocities following a given law
time - physical integration duration producing that sample

extract

public void extract(PartList plOut,
                    TestOfInt extractTest)
Extracts the particles of this list fullfilling the condition extractTest.test(flag) to the other list plOut.
This list is not modified and plOut is dimensionned to the right dimension.
All the needed global data of this list are copied to plOut:
the particle table partTable, meshes...

Overrides:
extract in class PartList

extractFraction

public PartList extractFraction(float ratio)
extracts a fraction of the list (at random)

Overrides:
extractFraction in class PartList
Parameters:
ratio - fraction of the list to be extracted
Returns:
the extracted sublist

inject

public void inject(PartList plIn)
injects the provided list plIn into this list.
Lists must be of the same subt-type but can have different particle type tables.
It amounts to concatenating the lists after updating the particles flag and index (transform "on surface i" into "in cell j").

Overrides:
inject in class PartList
Parameters:
plIn - input list
See Also:
concat(PartList)

concat

public void concat(PartList plIn)
concatenates the provided list plIn to this list.
Lists must be of the same subt-type (particle type tables can be different, this list partTable is complemented with the injected types).

Overrides:
concat in class PartList
Parameters:
plIn - input list to concatenate to this list

computeChargeOverMass

public void computeChargeOverMass(FloatScalTable chargeOverMass)
Overrides:
computeChargeOverMass in class PartList

clean

public void clean(TestOfInt selectPart,
                  IntScalTable selectTable)
Cleans the list, excluding particles verifying selectPart.test(selectTable[i])

Overrides:
clean in class PartList
Parameters:
selectPart -
selectTable -

setDim

public void setDim(int dimension)
sets the list dimension to dim: resizes the tables if needed, not preserving data (except if no resizing is needed).

Overrides:
setDim in class PartList

setDimPreserve

public void setDimPreserve(int dimension)
sets the list dimension to dim: resizes the tables if needed preserving data

Overrides:
setDimPreserve in class PartList

getSimilar

public PartList getSimilar()
returns a similar PartList, with same subtype and particle type(s) (and fixed weight), but empty (to be overriden by sub-types (derived classes)

Overrides:
getSimilar in class PartList

getPartListCopy

public PartList getPartListCopy()
returns a copy of this list (to be overriden by sub-types)

Overrides:
getPartListCopy in class PartList

getWeightTable

public FloatScalTable getWeightTable()
returns the table of particle weights (number of real particles in a superparticle)


getPartTypeIdTable

public IntScalTable getPartTypeIdTable()
returns the table of particle types


getChargeArray

public float[] getChargeArray()
Returns the array of the charges of each particle type (array index = particle type)


getMassArray

public float[] getMassArray()
Returns the array of the masses of each particle type (array index = particle type)


getChargeOverMassArray

public float[] getChargeOverMassArray()
Returns the array of the q/m ratios of each particle type (array index = particle type)


getPartTable

public PartTable getPartTable()
Returns:
particle table