spis.Surf.InteractModel
Class FunctionOfMaterial

java.lang.Object
  extended byspis.Surf.InteractModel.FunctionOfParticle
      extended byspis.Surf.InteractModel.FunctionOfParticleNothing
          extended byspis.Surf.InteractModel.FunctionOfMaterial
All Implemented Interfaces:
ScalFunctionOf3Scal, ScalFunctionOfNothing

public class FunctionOfMaterial
extends FunctionOfParticleNothing

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

Description : Returns a value only depending on the (impinged) material, not the particle kinetic parameters:
- compute(x, y, z): returns the value of material y if the material model x is the one selected in the constructor, and the particle Id is the one selected in the constructor
- compute(): this not-material-indexed function of this FunctionOfParticleNothing is not allowed (since htis class is specifically material dependent)

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  float defaultValue
          default value, returned for model Id different from modelId and particle Id different from particleId
private  float[] val
          array of value to be returned (index = material Id)
 
Fields inherited from class spis.Surf.InteractModel.FunctionOfParticle
defaultParamsId, materialRange, modelId, particleId, partTable
 
Constructor Summary
FunctionOfMaterial(ParameterSet[] params, float defaultValue_, int modelId, int particleId, PartTable partTable)
          Default constructor: the returned value is the first parameter of params
FunctionOfMaterial(ParameterSet[] params, int paramPosition, float defaultValue_, int modelId, int particleId, PartTable partTable)
          Constructor with an extra parameter: the returned value is the parameter of params in position paramPosition.
 
Method Summary
protected  float compute(int matId)
          Protected abstract method to be implemented by derived classes (the only one, always the one called by the public methods defined in FunctionOfParticleE)
 float getDefaultValue()
           
 int getModelId()
           
 int getParticleId()
           
 float[] getVal()
           
private  void initVal(ParameterSet[] params, int paramPosition)
          initialise the val array from the ParameterSet params, and the position of the parameters to be returned
 void setDefaultValue(float f)
           
 void setModelId(int i)
           
 void setParticleId(int i)
           
 void setVal(float[] fs)
           
 
Methods inherited from class spis.Surf.InteractModel.FunctionOfParticleNothing
compute, compute, compute, compute
 
Methods inherited from class spis.Surf.InteractModel.FunctionOfParticle
getDefaultParamsId, getMaterialRange, getPartTable, selectParamSet, setDefaultParams, setDefaultParamsId, setMaterialRange, setPartTable
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

defaultValue

private float defaultValue
default value, returned for model Id different from modelId and particle Id different from particleId


val

private float[] val
array of value to be returned (index = material Id)

Constructor Detail

FunctionOfMaterial

public FunctionOfMaterial(ParameterSet[] params,
                          float defaultValue_,
                          int modelId,
                          int particleId,
                          PartTable partTable)
Default constructor: the returned value is the first parameter of params

Parameters:
params - parameter sets: index = material id, in this constructor, the first param is returned
defaultValue_ - returned value if model or particle Id is not the accepted one
partTable - particle table the particle Id refers to

FunctionOfMaterial

public FunctionOfMaterial(ParameterSet[] params,
                          int paramPosition,
                          float defaultValue_,
                          int modelId,
                          int particleId,
                          PartTable partTable)
Constructor with an extra parameter: the returned value is the parameter of params in position paramPosition.

Parameters:
params - parameter sets: index = material id
paramPosition - in this constructor, the param of order paramPosition is returned (0, 1...)
defaultValue_ - returned value if model or particle Id is not the accepted one
partTable - particle table the particle Id refers to
Method Detail

initVal

private void initVal(ParameterSet[] params,
                     int paramPosition)
initialise the val array from the ParameterSet params, and the position of the parameters to be returned


compute

protected float compute(int matId)
Description copied from class: FunctionOfParticleNothing
Protected abstract method to be implemented by derived classes (the only one, always the one called by the public methods defined in FunctionOfParticleE)

Specified by:
compute in class FunctionOfParticleNothing
Parameters:
matId - material Id
Returns:
range [m] (not Angstrom, translation is done by l0)
See Also:
FunctionOfParticleNothing

getDefaultValue

public float getDefaultValue()
Returns:

getModelId

public int getModelId()
Overrides:
getModelId in class FunctionOfParticle
Returns:

getParticleId

public int getParticleId()
Overrides:
getParticleId in class FunctionOfParticle
Returns:

getVal

public float[] getVal()
Returns:

setDefaultValue

public void setDefaultValue(float f)
Parameters:
f -

setModelId

public void setModelId(int i)
Overrides:
setModelId in class FunctionOfParticle
Parameters:
i -

setParticleId

public void setParticleId(int i)
Overrides:
setParticleId in class FunctionOfParticle
Parameters:
i -

setVal

public void setVal(float[] fs)
Parameters:
fs -