spis.Surf.InteractModel
Class FunctionOfParticle

java.lang.Object
  extended byspis.Surf.InteractModel.FunctionOfParticle
Direct Known Subclasses:
FunctionOfParticleE, FunctionOfParticleETheta, FunctionOfParticleNothing

public abstract class FunctionOfParticle
extends java.lang.Object

Class Name : FunctionOfParticle
Project ref : SPIS project
File name : FunctionOfParticle.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 microscopic function class (i.e. a function of a single particle kinematic parameters, i.e. energy, impact angle...)
All microscopic function classes must be derived form this class.
For a given particle with defined energy an/or angle to normal, etc., it gives a scalar (which can e.g. be a yield, an energy of secondary particles, etc.)
The function can be hard-coded in a derived class. A simpler way is to use the default derived classes which compute the function from tabulated values versus particles energy and/or angle (TabulatedFunctionOfParticleE).
This class should not be directly derived, but one should rather derive again one of its derived classes (FunctionOfParticleE, etc.), which enforces defining:
1- the function of particle kinematic parameter(s) (E, E+theta, or nothing)
2- the same function of 3 extra parameters (material model Id,material Id, particle Id) which was specially designed for material interactions
These extra parameters (the material model Id and particle Id) refer to a material model array and a particle type table. It must be checked that the array these Ids refer to is the same as the array the FunctionOfParticle was based upon, hence the refence to these arrays requested in the constructor (can be null if the function with 3 extra parameters is not used)
NB: compare to FunctionOfDistrib, which does the same job for a whole distribution.

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  int defaultParamsId
          Id of the default parameter sets, that may be used by non-material-indexed compute(E) methods of derived classes
protected  int materialRange
          range of acceptable material Ids is [0, materialRange-1]
protected  int modelId
          Id of the material model this Function is related to (the material Id is local to this material model), if negative accepts any model Id
protected  int particleId
          Id of the particle type this Function only accepts (this particle Id itself refers to the PartTable contained in FunctionOfParticle parent class), if negative accepts any particle type Id
protected  PartTable partTable
          reference to the table of particle types the particle Id refers to in the second version of the function (with parameters)
 
Constructor Summary
FunctionOfParticle(int materialRange, int modelId, int particleId, PartTable partTable)
          Default constructor: request a reference to a material model array and a particle type table.
 
Method Summary
abstract  float compute(float[] velocity, float mass, float[] normal)
          generic interface allowing the computation of the function depending on particle energy, energy and angle to normal, or on nothing
abstract  float compute(float[] velocity, float mass, float[] normal, float matModId, float matId, float partId)
          generic interface allowing the computation of the function depending on particle energy, energy and angle to normal, or on nothing, and on the Ids of material model, material and particle
 int getDefaultParamsId()
           
 int getMaterialRange()
           
 int getModelId()
           
 int getParticleId()
           
 PartTable getPartTable()
           
protected  int selectParamSet(float matModId, float matId, float partId)
          selects the right parameter set if conditions are fulfilled
 void setDefaultParams(int matId)
          Defines the default parameter set as the internal paramSet of Id matId (amounts to selecting material matId) (may be used by non-material-indexed compute(E) function of derived classes)
NB: this could also be defined at higher level (FunctionOfPart), but not useful for now
 void setDefaultParamsId(int defaultParamsId)
           
 void setMaterialRange(int materialRange)
           
 void setModelId(int modelId)
           
 void setParticleId(int particleId)
           
 void setPartTable(PartTable table)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

materialRange

protected int materialRange
range of acceptable material Ids is [0, materialRange-1]


modelId

protected int modelId
Id of the material model this Function is related to (the material Id is local to this material model), if negative accepts any model Id


particleId

protected int particleId
Id of the particle type this Function only accepts (this particle Id itself refers to the PartTable contained in FunctionOfParticle parent class), if negative accepts any particle type Id


partTable

protected PartTable partTable
reference to the table of particle types the particle Id refers to in the second version of the function (with parameters)


defaultParamsId

protected int defaultParamsId
Id of the default parameter sets, that may be used by non-material-indexed compute(E) methods of derived classes

Constructor Detail

FunctionOfParticle

public FunctionOfParticle(int materialRange,
                          int modelId,
                          int particleId,
                          PartTable partTable)
Default constructor: request a reference to a material model array and a particle type table.
The material model Id and particle type Id passed to the function with parameters must refer to these array/table.

Parameters:
materialRange - range of acceptable material Ids is [0, materialRange-1] (any material if negative)
modelId - Id of the acceptable model Id to use this function of Particle (any, if negative)
particleId - Id of the acceptable particle Id to use this function of Particle (any, if negative)
partTable - particle table the particleId refers to
Method Detail

compute

public abstract float compute(float[] velocity,
                              float mass,
                              float[] normal)
generic interface allowing the computation of the function depending on particle energy, energy and angle to normal, or on nothing

Parameters:
velocity - particle velocity
mass - particle mass [amu]
normal - vector defining the angle origin
Returns:

compute

public abstract float compute(float[] velocity,
                              float mass,
                              float[] normal,
                              float matModId,
                              float matId,
                              float partId)
generic interface allowing the computation of the function depending on particle energy, energy and angle to normal, or on nothing, and on the Ids of material model, material and particle

Parameters:
velocity - particle velocity
mass - particle mass [amu]
normal - vector defining the angle origin
matModId - material model Id
matId - material Id
partId - particle Id
Returns:

setDefaultParams

public void setDefaultParams(int matId)
Defines the default parameter set as the internal paramSet of Id matId (amounts to selecting material matId) (may be used by non-material-indexed compute(E) function of derived classes)
NB: this could also be defined at higher level (FunctionOfPart), but not useful for now

Parameters:
matId -

getPartTable

public PartTable getPartTable()
Returns:

setPartTable

public void setPartTable(PartTable table)
Parameters:
table -

getModelId

public int getModelId()
Returns:
Returns the modelId.

setModelId

public void setModelId(int modelId)
Parameters:
modelId - The modelId to set.

getParticleId

public int getParticleId()
Returns:
Returns the particleId.

setParticleId

public void setParticleId(int particleId)
Parameters:
particleId - The particleId to set.

selectParamSet

protected int selectParamSet(float matModId,
                             float matId,
                             float partId)
selects the right parameter set if conditions are fulfilled


getDefaultParamsId

public int getDefaultParamsId()
Returns:
Returns the defaultParamsId.

setDefaultParamsId

public void setDefaultParamsId(int defaultParamsId)
Parameters:
defaultParamsId - The defaultParamsId to set.

getMaterialRange

public int getMaterialRange()
Returns:
Returns the materialRange.

setMaterialRange

public void setMaterialRange(int materialRange)
Parameters:
materialRange - The materialRange to set.