spis.Surf.SurfField
Class ScalSurfField

java.lang.Object
  extended byspis.Surf.SurfField.SurfField
      extended byspis.Surf.SurfField.ScalSurfField
All Implemented Interfaces:
java.io.Serializable

public class ScalSurfField
extends SurfField
implements java.io.Serializable

Class Name : ScalSurfField
Project ref : SPIS project
File name : ScalSurfField.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 : Scalar Surface Field 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
See Also:
Serialized Form

Field Summary
private  ScalSurfField curBuf
          buffer field (to avoid permanent memory allocation-deallocation)
private  FloatScalTable val
          Field values
 
Fields inherited from class spis.Surf.SurfField.SurfField
cent, name, sm, time
 
Constructor Summary
ScalSurfField(ScalSurfField f)
          Copy constructor
ScalSurfField(SurfMesh surfMesh, Centring centring)
          Default constructor, a Table is allocated (set to zero).
ScalSurfField(SurfMesh surfMesh, Centring centring, float value)
          Constructor defining the field from a passed value.
ScalSurfField(SurfMesh surfMesh, Centring centring, FloatScalTable values)
          Constructor defining the field from a passed table.
ScalSurfField(SurfMesh surfMesh, Centring centring, ScalFunctionOfVect f)
          Constructor defining the field from a passed scalar function of node/cell/... position.
 
Method Summary
 void add(SurfField field)
          Increments this field by another field (on the spot), which must indeed be a scalar field
 void applyFunc(ScalFunctionOfScal f)
          Applies the function f to this field (on the spot).
 void divide(ScalSurfField scalField)
          Divides this field by another field (on the spot)
 void equalTotalCurrent(SurfDistrib[] fluxes)
          Computes the total current [A/fqce] resulting from an array of fluxes (surface distributions).
 SurfField getSimilar()
          returns a similar SurfField: same subtype and same Centring
 FloatScalTable getTable()
          Provides the values of the field at a the mesh elements it is defined on (surfaces/edges/nodes depending on centring).
 boolean isOfSameSubtype(SurfField f)
          tests whether the passed field is of similar subtype
 boolean isUniform(float uniformValue)
          Tests whether a Field is uniform (same value all over the mesh).
 void linComb(float a1, SurfField field, float a2)
          Computes the linear combination a1*this + a2*field and affects it to this (field must be a scalar field)
 void mult(float factor)
          Multiplies this field by a constant factor (on the spot)
 void mult(ScalSurfField scalField)
          Multiplies this field by another field (on the spot)
 void mult(ScalSurfField scalField, float factor)
          Multiplies this field by another field and a constant factor (on the spot)
 void reset()
          Sets this field to zero value
 ScalSurfField returnDivide(ScalSurfField scalField)
          Divides this field by another field and returns the results as a new Field.
 void set(float value)
          Sets this field to a uniform value
 void set(ScalFunctionOfNothing f)
          Applies the function f (to nothing) and assigns the result to this Field hence equivalent to set(f.compute()).
 void set(ScalSurfField inField)
          Sets this field to the same local values as the passed field (copies the values).
 void set(ScalSurfField inField, int flag)
          Sets this field to the same local values as the passed field (copies the values).
 void set(ScalSurfField inField, ScalFunctionOfScal f)
          Applies the function f to the passed field and assigns the result to this Field.
 void set(ScalSurfField inField1, ScalSurfField inField2, float x3, ScalFunctionOf3Scal f)
          Applies the function f to the passed Fields/value and assigns the result to this Field.
 void set(ScalSurfField inField1, ScalSurfField inField2, ScalFunctionOf2Scal f)
          Applies the function f to the both passed field and assigns the result to this Field.
 void set(ScalSurfField inField1, ScalSurfField inField2, ScalSurfField inField3, float x4, ScalFunctionOf4Scal f)
          Applies the function f to the passed Fields/value and assigns the result to this Field.
 void set(ScalSurfField inField1, ScalSurfField inField2, ScalSurfField inField3, ScalSurfField inField4, float x5, ScalFunctionOf5Scal f)
          Applies the function f to the passed Fields/value and assigns the result to this Field.
 void setTable(FloatScalTable values)
          Sets the values of the field at a the mesh elements it is defined on (surfaces/edges/nodes depending on centring).
 void substract(float floatValue)
          Decrements this field by a scalar (on the spot)
 void substract(SurfField field)
          Decrements this field by another field (on the spot), which must indeed be a scalar field
 
Methods inherited from class spis.Surf.SurfField.SurfField
checkDim, checkSameMesh, checkSameMeshAndCentring, checkSameSubtype, getCentring, getName, getSm, getTime, setName, setTime
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

val

private FloatScalTable val
Field values


curBuf

private ScalSurfField curBuf
buffer field (to avoid permanent memory allocation-deallocation)

Constructor Detail

ScalSurfField

public ScalSurfField(SurfMesh surfMesh,
                     Centring centring)
Default constructor, a Table is allocated (set to zero).


ScalSurfField

public ScalSurfField(SurfMesh surfMesh,
                     Centring centring,
                     FloatScalTable values)
Constructor defining the field from a passed table.


ScalSurfField

public ScalSurfField(SurfMesh surfMesh,
                     Centring centring,
                     float value)
Constructor defining the field from a passed value.


ScalSurfField

public ScalSurfField(SurfMesh surfMesh,
                     Centring centring,
                     ScalFunctionOfVect f)
Constructor defining the field from a passed scalar function of node/cell/... position.


ScalSurfField

public ScalSurfField(ScalSurfField f)
Copy constructor

Method Detail

mult

public void mult(float factor)
Multiplies this field by a constant factor (on the spot)

Specified by:
mult in class SurfField

mult

public void mult(ScalSurfField scalField,
                 float factor)
Multiplies this field by another field and a constant factor (on the spot)

Specified by:
mult in class SurfField

mult

public void mult(ScalSurfField scalField)
Multiplies this field by another field (on the spot)

Specified by:
mult in class SurfField

divide

public void divide(ScalSurfField scalField)
Divides this field by another field (on the spot)

Specified by:
divide in class SurfField

add

public void add(SurfField field)
Increments this field by another field (on the spot), which must indeed be a scalar field

Specified by:
add in class SurfField

substract

public void substract(SurfField field)
Decrements this field by another field (on the spot), which must indeed be a scalar field

Specified by:
substract in class SurfField

substract

public void substract(float floatValue)
Decrements this field by a scalar (on the spot)


linComb

public void linComb(float a1,
                    SurfField field,
                    float a2)
Computes the linear combination a1*this + a2*field and affects it to this (field must be a scalar field)

Specified by:
linComb in class SurfField

returnDivide

public ScalSurfField returnDivide(ScalSurfField scalField)
Divides this field by another field and returns the results as a new Field.


applyFunc

public void applyFunc(ScalFunctionOfScal f)
Applies the function f to this field (on the spot).


getSimilar

public SurfField getSimilar()
returns a similar SurfField: same subtype and same Centring

Specified by:
getSimilar in class SurfField

isOfSameSubtype

public boolean isOfSameSubtype(SurfField f)
tests whether the passed field is of similar subtype

Specified by:
isOfSameSubtype in class SurfField

equalTotalCurrent

public void equalTotalCurrent(SurfDistrib[] fluxes)
Computes the total current [A/fqce] resulting from an array of fluxes (surface distributions).
The surface mesh (spacecraft or external boundary) the current is computed on is the one the this ScalSurfField lives on. It should usually be the spacecraft (to compute its collected or emitted current) but may also be the external boundary.

Parameters:
fluxes - input surfqce distributions

set

public void set(float value)
Sets this field to a uniform value


reset

public void reset()
Sets this field to zero value

Specified by:
reset in class SurfField

set

public void set(ScalSurfField inField)
Sets this field to the same local values as the passed field (copies the values).
Same mesh and centring requested (checked).


set

public void set(ScalSurfField inField,
                ScalFunctionOfScal f)
Applies the function f to the passed field and assigns the result to this Field.


set

public void set(ScalSurfField inField1,
                ScalSurfField inField2,
                ScalFunctionOf2Scal f)
Applies the function f to the both passed field and assigns the result to this Field.


set

public void set(ScalSurfField inField1,
                ScalSurfField inField2,
                float x3,
                ScalFunctionOf3Scal f)
Applies the function f to the passed Fields/value and assigns the result to this Field.


set

public void set(ScalSurfField inField1,
                ScalSurfField inField2,
                ScalSurfField inField3,
                float x4,
                ScalFunctionOf4Scal f)
Applies the function f to the passed Fields/value and assigns the result to this Field.


set

public void set(ScalSurfField inField1,
                ScalSurfField inField2,
                ScalSurfField inField3,
                ScalSurfField inField4,
                float x5,
                ScalFunctionOf5Scal f)
Applies the function f to the passed Fields/value and assigns the result to this Field.


set

public void set(ScalFunctionOfNothing f)
Applies the function f (to nothing) and assigns the result to this Field hence equivalent to set(f.compute()).


set

public void set(ScalSurfField inField,
                int flag)
Sets this field to the same local values as the passed field (copies the values).
Same mesh is requested (checked), but different centrings accepted. In case of different centring, a mapping is done, averaging data if flag = 0 (intensive quantity, as e.g. a potential), summing data if flag = 1 (extensive quantity, as e.g. a current)


getTable

public FloatScalTable getTable()
Provides the values of the field at a the mesh elements it is defined on (surfaces/edges/nodes depending on centring).
No copies done, pointing only.


setTable

public void setTable(FloatScalTable values)
Sets the values of the field at a the mesh elements it is defined on (surfaces/edges/nodes depending on centring).
No copies done, pointing only.


isUniform

public boolean isUniform(float uniformValue)
Tests whether a Field is uniform (same value all over the mesh).
If true, the uniform value is returned as parameter.
NB: only "false" can be returned in the current implementation, but uniform Fields or Tables will certainly be implemented later on, and solvers must use that to improve efficiency.