spis.Surf.SurfField
Class SurfField

java.lang.Object
  extended byspis.Surf.SurfField.SurfField
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
ScalSurfField, VectSurfField

public abstract class SurfField
extends java.lang.Object
implements java.io.Serializable

Class Name : SurfField (generic Surface Field class)
Project ref : SPIS project
File name : SurfField.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 abstract Surface Field class.
All Surface Field classes must be derived from this class. Some specific data are only to be defined in the derived classes. The abstract methods defined here must be implemented in the derived classes.
Similarly to volume fields, an important polymorphism is requested: - 3D/2D/1D: transparent for the Field, this polymorphism is taken into account at Mesh level
- scalar/vector: implemented by class derivation
- centring (values on surfaces/edges/nodes): handled through a centring parameter for simplicity sake
NB: it must be noted that the polymorphism of unstructured or structured meshes, i.e. here of fields living on an unstructured or a structured surface mesh, was not even mentioned since it is transparent for the field, similarly to the 3D/2D/1D polymorphism. All fields are simply stored as 1D tables and the 3D/2D/1D and structured/unstructured polymorphisms are treated at solver level (methods of the SurfMesh class). Solvers on structured meshes can chose to map the 1D storage of a field onto a more intuitive 3D storage (the cost of the mapping is small, or may even be zero if the 3D/1D storage in memory is kept identical).

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
protected  Centring cent
          centring of the field (values on cells/surfaces/edges/nodes)
protected  java.lang.String name
          Name of the filed (mostly used for post- processing since the name is carried by the variable in the solver, hence non mandatory field internally to NUM)
protected  SurfMesh sm
          Surface Mesh on which the field "lives"
protected  float time
          Time at which this field has been generated (mostly used for post-processing, hence non mandatory field internally to NUM)
 
Constructor Summary
SurfField(SurfMesh surfMesh, Centring centring)
          Default constructor, centring and volume mesh must be defined
 
Method Summary
abstract  void add(SurfField field)
          Increments this field by another field (on the spot), which must be of the same subtype
 void checkDim(Table table)
          Checks the dimension of the passed table is the right one for the mesh and centring of this field
 void checkSameMesh(SurfField scalField)
          Checks the passed field has same surface mesh.
 void checkSameMeshAndCentring(SurfField scalField)
          Checks the passed field has same surface mesh and centring.
 void checkSameSubtype(SurfField field)
          Decrements this field by another field (on the spot), which must indeed be a scalar field
abstract  void divide(ScalSurfField scalField)
          Divides this field by another scalar field (on the spot)
 Centring getCentring()
          returns SurfField Centring
 java.lang.String getName()
           
abstract  SurfField getSimilar()
          returns a similar SurfField: same subtype and same Centring
 SurfMesh getSm()
          returns the SurfMesh this SurfField lives on
 float getTime()
           
abstract  boolean isOfSameSubtype(SurfField f)
          tests whether the passed field is of similar subtype
abstract  void linComb(float a1, SurfField field, float a2)
          Computes the linear combination a1*this + a2*this and affects it to this field, (the SurfField field must be of same subtype as this)
abstract  void mult(float factor)
          Multiplies this field by a constant factor (on the spot)
abstract  void mult(ScalSurfField scalField)
          Multiplies this field by another scalar field (on the spot)
abstract  void mult(ScalSurfField scalField, float factor)
          Multiplies this field by another scalar field and a constant factor (on the spot)
abstract  void reset()
          Sets this field to zero value
 void setName(java.lang.String string)
           
 void setTime(float f)
           
abstract  void substract(SurfField field)
          Decrements this field by another field (on the spot), which must be of the same subtype
 
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 field "lives"


cent

protected Centring cent
centring of the field (values on cells/surfaces/edges/nodes)


name

protected java.lang.String name
Name of the filed (mostly used for post- processing since the name is carried by the variable in the solver, hence non mandatory field internally to NUM)


time

protected float time
Time at which this field has been generated (mostly used for post-processing, hence non mandatory field internally to NUM)

Constructor Detail

SurfField

public SurfField(SurfMesh surfMesh,
                 Centring centring)
Default constructor, centring and volume mesh must be defined

Method Detail

mult

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


mult

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


mult

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


divide

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


add

public abstract void add(SurfField field)
Increments this field by another field (on the spot), which must be of the same subtype


substract

public abstract void substract(SurfField field)
Decrements this field by another field (on the spot), which must be of the same subtype


linComb

public abstract void linComb(float a1,
                             SurfField field,
                             float a2)
Computes the linear combination a1*this + a2*this and affects it to this field, (the SurfField field must be of same subtype as this)


checkSameMeshAndCentring

public void checkSameMeshAndCentring(SurfField scalField)
Checks the passed field has same surface mesh and centring.
The centring must be similar, not necessarily the same instance (since a new Centring object is generated for each new field), whereas the surface mesh must be the same instance (since no copy of the surface mesh should be done).


checkSameMesh

public void checkSameMesh(SurfField scalField)
Checks the passed field has same surface mesh.


checkDim

public void checkDim(Table table)
Checks the dimension of the passed table is the right one for the mesh and centring of this field


getSimilar

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


isOfSameSubtype

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


checkSameSubtype

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


reset

public abstract void reset()
Sets this field to zero value


getCentring

public Centring getCentring()
returns SurfField Centring


getSm

public SurfMesh getSm()
returns the SurfMesh this SurfField lives on


getName

public java.lang.String getName()
Returns:
field name (mostly used for post-processing)

getTime

public float getTime()
Returns:
time of field creation (mostly used for post-processing)

setName

public void setName(java.lang.String string)
Parameters:
string - field name (mostly used for post-processing)

setTime

public void setTime(float f)
Parameters:
f - time of field creation (mostly used for post-processing)