spis.Surf.SurfMesh
Class SurfMesh

java.lang.Object
  extended byspis.Surf.SurfMesh.SurfMesh
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
UnstructSurfMesh

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

Class Name : SurfMesh (generic Surface Mesh class)
Project ref : SPIS project
File name : SurfMesh.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 Mesh class.
Stores mesh data and provides solvers since they are specific to the mesh type.
All Surface Mesh classes must be derived from this class. Specific data will only be defined in the derived classes for unstructured or structured mesh storage. The abstract methods defined here must be implemented in the derived classes.
A Surface Mesh may be a boundary of a volume mesh, or an interception surface, or both at the same time (in particular for unstructured volume mesh):
1. Boundary meshes support boundary conditions for volume field solvers
2. Interception surfaces intercept and emit particles, they can themselves be:
2.A. Physical spacecraft surfaces
2.B. Computation box boundaries (in which case they are also boundary meshes whatever the type of volume mesh)
These different types of surface meshes may or may not lead to a specialisation of the class, since the difference of data and methods seems to be rather small (Advance method only needed in case 2).

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  Geom geom
          geometry of the space this mesh lives in
private  VolMesh vm
          pointer to the Volume Mesh, of which SurfMesh is the boundary
 
Constructor Summary
SurfMesh(Geom geometry, VolMesh volMesh)
          Default constructor.
 
Method Summary
abstract  void advance(PartList pl, VectTable dx)
          Advances the particles of particle list pl from their current position to their next position, defined by the shift vector dx.
abstract  float[] applyScalFunction(Centring centring, ScalFunctionOfVect f)
          Applies a function of the position to the nodes (or surfaces/cells... depending on centring), and returns the result (f(xi,yi,zi)) as a float array.
abstract  float[][] applyVectFunction(Centring centring, VectFunctionOfVect f)
          Applies a vectorial function of the position to the nodes (or surfaces/cells... depending on centring), and returns the result (f(xi,yi,zi)) as a float[i][] array.
 boolean checkIsOnThisMesh(SurfField sf)
          tests whether this surface mesh is a surface mesh on this mesh
abstract  ScalSurfField[][] computeNeighbouringData()
          Computes and returns data characterising neighbour cells of a cell (needed for surface conductivity).
abstract  void currentDeposit(PartList pl, ScalSurfField cur)
          Performs the deposit of charges of the particle list pl in the current cur.
abstract  void deposit(PartList pl, ScalSurfField current, int charge, int mass)
          Performs the deposit of charges of the particle list pl in the ScalSurfField current (current is incremented, reset it before if you want to start from 0).
abstract  int[] getEdgeFlag()
           
abstract  ScalSurfField getEdgeLength()
          Returns length of edges
abstract  float[] getEdgeRadius()
          Returns real radius of thin wires
abstract  int getElNb(Centring cent)
          Provides the number of elements for a field with this centring
(on nodes/cells/...)
abstract  int getElNb(int relDim)
          Returns the number of elements of relative dimension relDim
 Geom getGeom()
          gets geometry (pointer, no copy)
abstract  ScalSurfField getSurfArea()
          returns surface areas
abstract  VectSurfField getSurfNormal()
          provides normals to mesh surfaces
abstract  float[] getSurfThickness()
          Returns real thickness of thin plates
 VolMesh getVm()
          gets volume mesh (pointer, no copy)
abstract  void interpolate(PointList pl, SurfField sf, Table val)
          Interpolates the surface field sf (defined on the mesh nodes/cells/...)
abstract  void mapField(ScalSurfField fin, ScalSurfField fout, int flag)
          Maps surface fields of different centering into one another (fin into fout).
abstract  void samplePos(IntScalTable indexT, SpaceVectTable posT)
          Performs a random sampling of particle positions.
 void setVm(VolMesh volMesh)
          sets volume mesh (pointer, no copy)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

geom

private Geom geom
geometry of the space this mesh lives in


vm

private VolMesh vm
pointer to the Volume Mesh, of which SurfMesh is the boundary

Constructor Detail

SurfMesh

public SurfMesh(Geom geometry,
                VolMesh volMesh)
Default constructor.
If surface meshes are not yet built (because of the loop vol <=> surf), pass a null pointer to this constructor and do use setters later.

Method Detail

currentDeposit

public abstract void currentDeposit(PartList pl,
                                    ScalSurfField cur)
Performs the deposit of charges of the particle list pl in the current cur. The deposit can be zero order (NGP), or order one (~PIC)... The deposit can be performed on surfaces or nodes depending on the centring of cur (maybe only one of them will need to be implemented).
Higher order momenta may also be needed (energy flux...).
In the particle list pl, only the particles arrived on surfaces are taken into account (determined by their flags)


deposit

public abstract void deposit(PartList pl,
                             ScalSurfField current,
                             int charge,
                             int mass)
Performs the deposit of charges of the particle list pl in the ScalSurfField current (current is incremented, reset it before if you want to start from 0).
The number of (phycical) particles is miltiplied by their charge if charge is 1 (not if 0) and by their mass if mass = 1.
In the particle list pl, only the particles arrived this surface are taken into account (determined by their flags)
Ex: deposit(pl, cur, 1, 0) returns the (charge) current onto the surface in cur.
Units-Normalisation: - if charge, charge in Coulombs (not elementary mass units as when individual particles are considered)
- if mass, mass in kg (not amu as for individual particles)
- Results are not divided by surface area, they are indeed particle numbers (or charge but not charge par area)
NB: for now, only surface-centred result fields are supported (0-th order method, NGP-like: counts particles on each surface element).


advance

public abstract void advance(PartList pl,
                             VectTable dx)
Advances the particles of particle list pl from their current position to their next position, defined by the shift vector dx. The flags and indices of the particles in PartListare updated (each particle flag indicates the particle status (in_vol/on_surf/null/...) and the index is the index of particle cell or surface) It is basically an intersection computation, the dynamics itself is computed in PartList.move method. Depending on the specialisation of the Surface mesh, this Advance service is first requested from the volume mesh, not the present surface mesh. In case of an unstructured volume mesh, the advance, or interception, service is implemented at volume mesh level, but in case of structured mesh, this service is transferred to the spacecraft surface mesh as in PicUp3D (the surface mesh is of type 2.A. above: Interception/ Physical_spacecraft)

Parameters:
pl - List of particles to be advanced
dx - Shift vectors for particles

interpolate

public abstract void interpolate(PointList pl,
                                 SurfField sf,
                                 Table val)
Interpolates the surface field sf (defined on the mesh nodes/cells/...) at the points of the point list pl (particle positions). The field values are returned in val. The Table of values val must be of the same type as the field (vector/scalar/...) More than the point position may be used in PointList, as e.g. the index of the current surface cell of the particle (unstructured meshes).
NB: similar to homonym method of VolField, but here the need for this method is not so sure
Virtual method, to be implemented in derived classes.

Parameters:
pl - Point list at which interpolation is requested (input)
sf - Surface Field to be interpolated
val - Table with interpolated values

applyScalFunction

public abstract float[] applyScalFunction(Centring centring,
                                          ScalFunctionOfVect f)
Applies a function of the position to the nodes (or surfaces/cells... depending on centring), and returns the result (f(xi,yi,zi)) as a float array.


applyVectFunction

public abstract float[][] applyVectFunction(Centring centring,
                                            VectFunctionOfVect f)
Applies a vectorial function of the position to the nodes (or surfaces/cells... depending on centring), and returns the result (f(xi,yi,zi)) as a float[i][] array.


samplePos

public abstract void samplePos(IntScalTable indexT,
                               SpaceVectTable posT)
Performs a random sampling of particle positions. Particles of index n are generated on surface n.

Parameters:
indexT - surface index of each particle (input)
posT - position of each particle (output)

computeNeighbouringData

public abstract ScalSurfField[][] computeNeighbouringData()
Computes and returns data characterising neighbour cells of a cell (needed for surface conductivity). Returned data is a ScalSurfField[][], with:
- result[n][0]: the Ids of n-th neighbour cell (-1 if not existing)
- result[n][1]: length of the edge shared with the n-th neighbour cell
- result[n][2]: distance from the centre of this cell to the edge shared with the n-th neighbour cell
- result[n][3]: distance from the centre of the n-th neighbour to the common edge
In the generic routine, the range of n values is arbitrary (0-3 for quadrangle meshes, 0-2 for triangle meshes)

Returns:

getElNb

public abstract int getElNb(Centring cent)
Provides the number of elements for a field with this centring
(on nodes/cells/...)


getElNb

public abstract int getElNb(int relDim)
Returns the number of elements of relative dimension relDim


getSurfNormal

public abstract VectSurfField getSurfNormal()
provides normals to mesh surfaces


getSurfArea

public abstract ScalSurfField getSurfArea()
returns surface areas


getEdgeLength

public abstract ScalSurfField getEdgeLength()
Returns length of edges


getEdgeRadius

public abstract float[] getEdgeRadius()
Returns real radius of thin wires


getEdgeFlag

public abstract int[] getEdgeFlag()
Returns:
Returns the edgeFlag

getSurfThickness

public abstract float[] getSurfThickness()
Returns real thickness of thin plates


mapField

public abstract void mapField(ScalSurfField fin,
                              ScalSurfField fout,
                              int flag)
Maps surface fields of different centering into one another (fin into fout). If flag = 1, the quantity is extensive (which results in sommations), if flag = 0, it is intensive (which results in averages).


checkIsOnThisMesh

public boolean checkIsOnThisMesh(SurfField sf)
tests whether this surface mesh is a surface mesh on this mesh


setVm

public void setVm(VolMesh volMesh)
sets volume mesh (pointer, no copy)


getVm

public VolMesh getVm()
gets volume mesh (pointer, no copy)


getGeom

public Geom getGeom()
gets geometry (pointer, no copy)