spis.Surf.SurfMesh
Class ThreeDUnstructSurfMesh

java.lang.Object
  extended byspis.Surf.SurfMesh.SurfMesh
      extended byspis.Surf.SurfMesh.UnstructSurfMesh
          extended byspis.Surf.SurfMesh.ThreeDUnstructSurfMesh
All Implemented Interfaces:
java.io.Serializable

public class ThreeDUnstructSurfMesh
extends UnstructSurfMesh
implements java.io.Serializable

Class Name : ThreeDUnstructSurfMesh (generic Surface Mesh class)
Project ref : SPIS project
File name : ThreeDUnstructSurfMesh.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 : 3-dimensional Unstructured Surface Mesh class (triangles only)
Specificities and constraints:
- thin surfaces, i.e. whose both sides are physical (e.g. a solar array) must be duplicated and tagged - the i-th surfNode of a surf must be "opposite" the i-th surfEdge (i-th node does not belong to the i-th edge)

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

Constructor Summary
ThreeDUnstructSurfMesh(Geom geometry, ThreeDUnstructVolMesh volMesh, int surfNbr, int edgeNbr, int nodeNbr, int[][] surfEdges, int[][] surfNodes, int[][] edgeNodes, int[] surfFlags, int[] surfIndices, int[] surfIndicesS2, float[] surfThicknesses, int[] edgeFlags, int[] edgeIndices, int[] edgeIndicesS2, float[] edgeRadiuses, int[] nodeFlags, int[] nodeIndices, int[] nodeIndicesS2, float[][] xyzCoord)
          Main constructor with basic sufficient data provided.
 
Method Summary
 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.
 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.
 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.
 VectSurfField buildSurfCentre()
          Builds and returns the table of the surface centre coordinates as a surface-centred VectSurfField
 ScalSurfField[][] computeNeighbouringData()
          Computes and returns data characterising neighbour cells of a cell (needed for surface conductivity).
 void currentDeposit(PartList pl, ScalSurfField cur)
          Performs the deposit of charges of the particle list pl in the current cur.
 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).
 int[] getEdgeFlag()
           
 ScalSurfField getEdgeLength()
          Returns length of edges
 float[] getEdgeRadius()
          Returns real radius of thin wires
 int getElNb(Centring centring)
          Returns the number of elements of dimension dim of a given centring
 int getElNb(int relDim)
          Returns the number of elements of relative dimension relDim
 VectSurfField getNodeCoord()
          Returns the table of the nodes/points coordinates as node-centred VectSurfField
 int[] getNodeIndex()
          Returns nodeIndex, i.e. index of the nodes in the VolMesh numbering
 ScalSurfField getSurfArea()
          returns surface areas as a ScalSurfField
 int[] getSurfIndex()
          Returns surfIndex, i.e.index of the surface in the numbering of the volume mesh
 int[][] getSurfNode()
          Returns the table of the nodes/points of each surface as an int[][].
 VectSurfField getSurfNormal()
          returns normals to mesh surfaces as a VectSurfField
 float[] getSurfThickness()
          Returns real thickness of thin plates
 void initialise()
          Performs extra mesh initialisations.
 void interpolate(PointList pl, SurfField sf, Table val)
          Interpolates the surface field sf (defined on the mesh nodes/cells/...)
 boolean isVolNodeRenumbered()
           
 void mapField(ScalSurfField fin, ScalSurfField fout, int flag)
          Maps surface fields of different centering into one another (fin into fout).
 void rebuildIndexTables(int[] surfIndexV, int[] edgeIndexV, int[] nodeIndexV, int[] surfFlagV, int[] edgeFlagV, int[] nodeFlagV, int flagMask)
          Obsolete, no longer used.
 void samplePos(IntScalTable indexT, SpaceVectTable posT)
          Performs a random sampling of particle positions.
 void setSurfArea(float[] surfArea)
           
 void setVm(ThreeDUnstructVolMesh volMesh)
          sets volume mesh (pointer, no copy), and orients the surface normals of the surface mesh coming out out of the volume mesh (the order of the surface nodes is modified accordingly).
 void setVolInternNodeNumbering(int[] internNum)
          Updates pointers to volume nodes (nodeIndex and nodeIndex2) when volume nodes are renumbered (checks it is not done a second time).
 void setVolNodeRenumbered(boolean b)
           
 
Methods inherited from class spis.Surf.SurfMesh.SurfMesh
checkIsOnThisMesh, getGeom, getVm, setVm
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ThreeDUnstructSurfMesh

public ThreeDUnstructSurfMesh(Geom geometry,
                              ThreeDUnstructVolMesh volMesh,
                              int surfNbr,
                              int edgeNbr,
                              int nodeNbr,
                              int[][] surfEdges,
                              int[][] surfNodes,
                              int[][] edgeNodes,
                              int[] surfFlags,
                              int[] surfIndices,
                              int[] surfIndicesS2,
                              float[] surfThicknesses,
                              int[] edgeFlags,
                              int[] edgeIndices,
                              int[] edgeIndicesS2,
                              float[] edgeRadiuses,
                              int[] nodeFlags,
                              int[] nodeIndices,
                              int[] nodeIndicesS2,
                              float[][] xyzCoord)
Main constructor with basic sufficient data provided.
the connectivity to edges is also needed to have the same numbering as in the external framework.
The tables are not copied, the new ThreeDUnstructSurfMesh instance simply points to the provided tables.

Method Detail

initialise

public void initialise()
Performs extra mesh initialisations.
Must be called at the end of the constructor after passed variables are stored.
Tasks performed are:
- initialisation of area/length/normals...
- computation of maps for mapping to/from circuit fields


rebuildIndexTables

public void rebuildIndexTables(int[] surfIndexV,
                               int[] edgeIndexV,
                               int[] nodeIndexV,
                               int[] surfFlagV,
                               int[] edgeFlagV,
                               int[] nodeFlagV,
                               int flagMask)
Obsolete, no longer used. Temporary method, to build tables which where not initialised in the framework, as they should. xxxFlag are assumed to be correctly filled, and xxxIndexYY are assumed allocated but not correctly filled (xxx = surf/edge/node, YY=''/SC/B) both for this surfMesh and the volMesh. The tables xxxIndexYY are built here (again, both for this surfMesh and the volMesh)


currentDeposit

public void currentDeposit(PartList pl,
                           ScalSurfField cur)
Performs the deposit of charges of the particle list pl in the current cur.
For now the deposit is zero order (NGP), hence a surface-centred current is needed.
Units are Coulombs (not Coulombs per surface unit).
In the particle list pl, only the particles arrived on surfaces are taken into account (determined by their flags)

Specified by:
currentDeposit in class SurfMesh

deposit

public 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 elementary charge units
- if mass, mass in amu
- 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).

Specified by:
deposit in class SurfMesh

advance

public 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)

Specified by:
advance in class SurfMesh
Parameters:
pl - List of particles to be advanced
dx - Shift vectors for particles

interpolate

public 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.

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

mapField

public 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).
Supported mappings are:
- between nodes and surfaces (excluding nodes of 1D wires, considered as not linked to neighbour triangles),
- between nodes and edges of 1D wires

Specified by:
mapField in class SurfMesh

computeNeighbouringData

public 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), here it is 0-2.

Specified by:
computeNeighbouringData in class SurfMesh
Returns:

setVolInternNodeNumbering

public void setVolInternNodeNumbering(int[] internNum)
Updates pointers to volume nodes (nodeIndex and nodeIndex2) when volume nodes are renumbered (checks it is not done a second time).


applyScalFunction

public 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.

Specified by:
applyScalFunction in class SurfMesh

applyVectFunction

public 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.

Specified by:
applyVectFunction in class SurfMesh

samplePos

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

Specified by:
samplePos in class SurfMesh
Parameters:
indexT - surface index of each particle (input)
posT - position of each particle (output)

getElNb

public int getElNb(Centring centring)
Returns the number of elements of dimension dim of a given centring

Specified by:
getElNb in class SurfMesh

getElNb

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

Specified by:
getElNb in class SurfMesh

getSurfNormal

public VectSurfField getSurfNormal()
returns normals to mesh surfaces as a VectSurfField

Specified by:
getSurfNormal in class SurfMesh

getSurfArea

public ScalSurfField getSurfArea()
returns surface areas as a ScalSurfField

Specified by:
getSurfArea in class SurfMesh

getEdgeLength

public ScalSurfField getEdgeLength()
Description copied from class: SurfMesh
Returns length of edges

Specified by:
getEdgeLength in class SurfMesh
Returns:
Returns the edgeLength as a ScalSurfField.

getNodeCoord

public VectSurfField getNodeCoord()
Returns the table of the nodes/points coordinates as node-centred VectSurfField


buildSurfCentre

public VectSurfField buildSurfCentre()
Builds and returns the table of the surface centre coordinates as a surface-centred VectSurfField


getSurfNode

public int[][] getSurfNode()
Returns the table of the nodes/points of each surface as an int[][].


getSurfIndex

public int[] getSurfIndex()
Returns surfIndex, i.e.index of the surface in the numbering of the volume mesh


getNodeIndex

public int[] getNodeIndex()
Returns nodeIndex, i.e. index of the nodes in the VolMesh numbering


setVm

public void setVm(ThreeDUnstructVolMesh volMesh)
sets volume mesh (pointer, no copy), and orients the surface normals of the surface mesh coming out out of the volume mesh (the order of the surface nodes is modified accordingly).


isVolNodeRenumbered

public boolean isVolNodeRenumbered()
Returns:
true if node renumbering is on (defined by CutHill McKee renumbering)

setVolNodeRenumbered

public void setVolNodeRenumbered(boolean b)
Parameters:
b - declare if node renumbering is on (defined by CutHill McKee renumbering)

getEdgeRadius

public float[] getEdgeRadius()
Description copied from class: SurfMesh
Returns real radius of thin wires

Specified by:
getEdgeRadius in class SurfMesh
Returns:

getSurfThickness

public float[] getSurfThickness()
Description copied from class: SurfMesh
Returns real thickness of thin plates

Specified by:
getSurfThickness in class SurfMesh
Returns:

getEdgeFlag

public int[] getEdgeFlag()
Specified by:
getEdgeFlag in class SurfMesh
Returns:
Returns the edgeFlag.

setSurfArea

public void setSurfArea(float[] surfArea)
Parameters:
surfArea - The surfArea to set.