spis.Vol.VolMesh
Class VolMesh

java.lang.Object
  extended byspis.Vol.VolMesh.VolMesh
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
UnstructVolMesh

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

Class Name : VolMesh (generic Volume Mesh class)
Project ref : SPIS project
File name : VolMesh.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 Volume Mesh class.
Stores mesh data and provides solvers since they are specific to the mesh type.
All Volume Mesh classes must be derived from this class. Specific data 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.

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
VolMesh(Geom geometry, SurfMesh boundarySurfMesh, SurfMesh scSurfMesh)
          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.
abstract  void computeGradient(PointList pl, ScalVolField vf, VectTable val)
          Similar to Interpolate, but the gradient of a volume field is computed.
abstract  void currentDeposit(PartList pl, VectVolField cur)
          Performs the PIC deposit of current of the particle list pl in the current density cur.
abstract  void deposit(PartList pl, ScalVolField dens, int charge, int mass)
          Performs the PIC deposit of charges of the particle list pl in the density dens (dens is incremented, reset it before if you want to start from 0).
 void eulerSolve(ScalVolField dens, VectVolField cur, ScalVolField E, ScalVolField B, BC bc)
          Solves Euler equation for the density and current density dens and cur in the electric and magnetic fields E and B.
 SurfMesh getBsm()
          gets boundary surface mesh (pointer, no copy)
abstract  ScalVolField getCellVolField()
          Returns cell volumes
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  IntScalTable getInjectionCell(IntScalTable flagTable, IntScalTable indexTable)
          Returns the table of the cell indices of particles particles injected from boundaries
abstract  ScalVolField getNodeVolField()
          Returns node volumes
 SurfMesh getScsm()
          gets spacecraft surface mesh (pointer, no copy)
 float getTotalVol()
          Returns th total volume of the mesh
abstract  void interpolate(PointList pl, VolField vf, Table val)
          Interpolates the volume field vf (defined on the mesh nodes/cells/...)
abstract  void mapToExternalNodeIndexing(float[][] internIndexed, float[][] externIndexed)
          Maps integer node-centered quantities from an internal-node-number-indexed array to an external-node-number-indexed array.
abstract  void mapToExternalNodeIndexing(float[] internIndexed, float[] externIndexed)
          Maps node-centered quantities from an internal-node-number-indexed array to an external-node-number-indexed array.
abstract  void mapToInternalNodeIndexing(float[][] externIndexed, float[][] internIndexed)
          Maps node-centered quantities from an external-node-number-indexed array to an internal-node-number-indexed array.
abstract  void mapToInternalNodeIndexing(float[] externIndexed, float[] internIndexed)
          Maps node-centered quantities from an external-node-number-indexed array to an internal-node-number-indexed array.
abstract  void mapToSurfField(ScalVolField fIn, ScalSurfField fOut, int flag)
          Maps a volume field onto a surface fields.
 void maxwellSolve(VectVolField E, VectVolField B, ScalVolField dens, VectVolField cur, BC bc)
          Maxwell solver, not implemented.
 void mhdSolve(ScalVolField dens, VectVolField cur, VectVolField B, BC bc)
          MHD equation solver, not implemented.
abstract  void poissonSolve(VectVolField E, ScalVolField dens, PoissonBC bc)
          Solves Poison equation for electric field E (indeed for the potential from which it derives if E is stored as a potential, i.e. of sub-type PotVectVolField) and density dens.
abstract  void samplePos(IntScalTable indexT, SpaceVectTable posT)
          Performs a random sampling of particle positions.
 void setBsm(SurfMesh sm)
          sets boundary surface mesh (pointer, no copy)
 void setScsm(SurfMesh sm)
          sets spacecraft surface mesh (pointer, no copy)
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VolMesh

public VolMesh(Geom geometry,
               SurfMesh boundarySurfMesh,
               SurfMesh scSurfMesh)
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

interpolate

public abstract void interpolate(PointList pl,
                                 VolField vf,
                                 Table val)
Interpolates the volume field vf (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 cell of the particle (unstructured meshes).
Ex: Interpolate(pl,E,E_values).
Virtual method, to be implemented in derived classes.


computeGradient

public abstract void computeGradient(PointList pl,
                                     ScalVolField vf,
                                     VectTable val)
Similar to Interpolate, but the gradient of a volume field is computed. As a consequence val is a tensor of larger order than VolField by one unit (e.g. vf scalar, val vector => Gradient(PartList pl,ScalVolField vf,VectTable val))
Ex: Gradient(pl,potential,"-E_values")
Virtual method, to be implemented in derived classes.

See Also:
interpolate(PointList, VolField, Table)

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 are updated (each particle flag indicates the particle status in_vol/on-surf/null/… and the index is the index of particle cell/surface/…) It is basically an intersection computation, the dynamics itself is computed in PartList.move method. Depending on the specialisation of the volume mesh, this Advance service can be requested from the boundary surface mesh (in case of structured volume mesh and unstructured surface mesh as in PicUp).
Virtual method, to be implemented in derived classes.


deposit

public abstract void deposit(PartList pl,
                             ScalVolField dens,
                             int charge,
                             int mass)
Performs the PIC deposit of charges of the particle list pl in the density dens (dens is incremented, reset it before if you want to start from 0).
If charge=1, particle number is multiplied by particle charge
If mass=1, particle number is multiplied by particle mass
Examples:
- deposit(pl, dens, 0, 0) computes number density
- deposit(pl, dens, 1, 0) computes charge density
- deposit(pl, dens, 0, 1) computes mass density


currentDeposit

public abstract void currentDeposit(PartList pl,
                                    VectVolField cur)
Performs the PIC deposit of current of the particle list pl in the current density cur.
Virtual method, to be implemented in derived classes.


poissonSolve

public abstract void poissonSolve(VectVolField E,
                                  ScalVolField dens,
                                  PoissonBC bc)
Solves Poison equation for electric field E (indeed for the potential from which it derives if E is stored as a potential, i.e. of sub-type PotVectVolField) and density dens. The boundary conditions are defined in bc. The type BC, for boundary condition, is still TBD today, , but will consist of a few surface fields for the surface parameters describing the boundary conditions (different derived types).
Virtual method, to be implemented in derived classes.


maxwellSolve

public void maxwellSolve(VectVolField E,
                         VectVolField B,
                         ScalVolField dens,
                         VectVolField cur,
                         BC bc)
Maxwell solver, not implemented.


eulerSolve

public void eulerSolve(ScalVolField dens,
                       VectVolField cur,
                       ScalVolField E,
                       ScalVolField B,
                       BC bc)
Solves Euler equation for the density and current density dens and cur in the electric and magnetic fields E and B.
Not implemented.


mhdSolve

public void mhdSolve(ScalVolField dens,
                     VectVolField cur,
                     VectVolField B,
                     BC bc)
MHD equation solver, not implemented.


mapToInternalNodeIndexing

public abstract void mapToInternalNodeIndexing(float[][] externIndexed,
                                               float[][] internIndexed)
Maps node-centered quantities from an external-node-number-indexed array to an internal-node-number-indexed array.


mapToInternalNodeIndexing

public abstract void mapToInternalNodeIndexing(float[] externIndexed,
                                               float[] internIndexed)
Maps node-centered quantities from an external-node-number-indexed array to an internal-node-number-indexed array.


mapToExternalNodeIndexing

public abstract void mapToExternalNodeIndexing(float[][] internIndexed,
                                               float[][] externIndexed)
Maps integer node-centered quantities from an internal-node-number-indexed array to an external-node-number-indexed array.


mapToExternalNodeIndexing

public abstract void mapToExternalNodeIndexing(float[] internIndexed,
                                               float[] externIndexed)
Maps node-centered quantities from an internal-node-number-indexed array to an external-node-number-indexed array.


mapToSurfField

public abstract void mapToSurfField(ScalVolField fIn,
                                    ScalSurfField fOut,
                                    int flag)
Maps a volume field onto a surface fields. if they have different centring, interpolation may be needed on the surface (not all types supported): if flag = 1, the quantity is extensive, which results in sommations, if flag = 0, it is intensive, which results in averages.


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 in cell n.


getInjectionCell

public abstract IntScalTable getInjectionCell(IntScalTable flagTable,
                                              IntScalTable indexTable)
Returns the table of the cell indices of particles particles injected from boundaries

Parameters:
flagTable - flag of the particles (on SC or on boundary, cf PartList)
indexTable - surface index for a particle on a surface mesh
Returns:
cell indices (in this VolMesh numbering)

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


getCellVolField

public abstract ScalVolField getCellVolField()
Returns cell volumes


getNodeVolField

public abstract ScalVolField getNodeVolField()
Returns node volumes


getTotalVol

public float getTotalVol()
Returns th total volume of the mesh


setBsm

public void setBsm(SurfMesh sm)
sets boundary surface mesh (pointer, no copy)


setScsm

public void setScsm(SurfMesh sm)
sets spacecraft surface mesh (pointer, no copy)


getBsm

public SurfMesh getBsm()
gets boundary surface mesh (pointer, no copy)


getScsm

public SurfMesh getScsm()
gets spacecraft surface mesh (pointer, no copy)


getGeom

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