|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectspis.Vol.VolMesh.VolMesh
spis.Vol.VolMesh.UnstructVolMesh
spis.Vol.VolMesh.ThreeDUnstructVolMesh
Class Name : ThreeDUnstructVolMesh (generic Volume Mesh class)
Project ref : SPIS project
File name : ThreeDUnstructVolMesh.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 Volume Mesh class (tetrahedra only).
Derives from UnstructVolMesh class.
Most methods and data shall be implemented at this level.
Constraints on cell/surf/edge/node numbering:
- the i-th cellNode of a cell must be "opposite" the i-th cellSurf
(i-th node does not belong to i-th surface)
- the i-th surfNode of a surf must be "opposite" the i-th surfEdge
- ...
Versions and anomalies correction :
Version number | Author (name, e-mail) | Corrections/Modifications |
0.1 | JF Roussel, roussel@onecert.fr and D Volpert, Dominique.Volpert@cert.fr | Creation |
Field Summary | |
private ThreeDUnstructSurfMesh |
bsm
pointer to the 3D untructured surface mesh, external boundary of the simulation box (not a physical surface) |
private float[] |
bufferNodeArrayF
buffer used to renumber node quantities on the spot (it is stored as object variable to avoid intensive memory re-allocation) |
private int[] |
bufferNodeArrayI
buffer used to renumber node quantities on the spot (it is stored as object variable to avoid intensive memory re-allocation) |
private int[][] |
cellEdge
edges of a cell (int[cellNb][6]) |
private int |
cellNb
cell (tetrahedra) number |
private int[][] |
cellNode
nodes of a cell (int[cellNb][4]). |
private int[][] |
cellSurf
pointers (indices) to the surfaces surrounding a cell (int[cellNb][4]). |
private float[] |
cellVol
Cell volume |
private int[] |
edgeFlag
edge flag (int[edgeNb]) to tag special edges. : - bit 0: 0 = not on a spacrecraft surface 1 = on a spacecraft surface - bit 1: 0 = not on a thin SC surface 1 = on a thin SC surface (meaningful only if bit 0 = 1) - bit 2: 0 = not a wire-like boom 1 = wire-like boom (1D physical surface) (meaningful only if 1st bit = 1 and 2nd bit = 0) - bit 3: 0 = not a mesh boundary edge 1 = it is a mesh boundary edge next bits may be used (transiently) to tag special edges for monitoring... |
private int[] |
edgeIndexB
for an edge of the boundary SurfMesh (fourth bit of edgeFlag = 1), index of the edge in the boundary SurfMesh numbering |
private int[] |
edgeIndexSC
for an edge of the spacecraft SurfMesh (first bit of edgeFlag = 1), index of the edge in the SC SurfMesh numbering |
private float[] |
edgeLength
Edge length |
private int |
edgeNb
edge number |
private int[][] |
edgeNode
nodes of an edge (int[edgeNb][2]) |
private int[] |
externNum
external numbering, dimensionned only if nodeRenumbering = true (externNum[internalId] = externalId) |
private int[] |
internNum
internal numbering, dimensionned only if nodeRenumbering = true (internNum[externalId] = internalId) |
private int[] |
nodeFlag
node flag (int[nodeNb]) to tag special nodes. : - bit 0: 0 = not on a spacrecraft surface 1 = on a spacecraft surface - bit 1: 0 = not on a thin SC surface 1 = on a thin SC surface (meaningful only if bit 0 = 1) - bit 2: 0 = not a node of a wire-like boom 1 = node of a wire-like boom (1D physical surface) (meaningful only if 1st bit = 1 and 2nd bit = 0) - bit 3: 0 = not a mesh boundary node 1 = it is a mesh boundary node next bits may be used (transiently) to tag special nodes for monitoring... |
private int[] |
nodeIndexB
for a node of the boundary SurfMesh (third bit of nodeFlag = 1), index of the node in the boundary SurfMesh numbering |
private int[] |
nodeIndexSC
for a node of the spacecraft SurfMesh (first bit of nodeFlag = 1), index of the node in the SC SurfMesh numbering |
private int |
nodeNb
node (points) number |
private boolean |
nodeRenumbering
Is node renumbering on ? |
private float[] |
nodeVol
Can be viewed by physicists as the 'effective' volume surrounding a node, which allows to compute the density from the particle number obtained by PIC charge deposit (numericians would rather call it the lumped mass matrix) |
private ThreeDUnstructSurfMesh |
scsm
pointer to the 3D untructured spacecraft surface mesh, (a physical surface) |
private float[] |
surfArea
Surface area |
private int[][] |
surfCell
cells around a surface (int[surfNb][2]) (negative value if out of mesh) |
private int[][] |
surfEdge
edges of a surface (int[surfNb][3]) |
private int[] |
surfFlag
surface flag (int[surfNb]) to tag special surfaces. : - lowest weight bit: 0 = not a spacecraft surface (bit 0) 1 = on a spacecraft surface - next bit: 0 = not a thin surface (bit 1) 1 = it is a thin surface (meaningful only if bit 0 = 1) - bit 2: = 0 - bit 3: 0 = not a mesh boundary surface 1 = it is a mesh boundary surface next bits may be used (transiently) to tag special surfaces for monitoring, as current computation through a virtual instrument... |
private int[] |
surfIndexB
for a surface of the boundary SurfMesh (bit 3 of surfFlag = 1), index of the surface in the boundary SurfMesh numbering |
private int[] |
surfIndexSC
for a surface of the spacecraft SurfMesh (bit 0 of surfFlag = 1), index of the surface in the SC SurfMesh numbering |
private int |
surfNb
surface (triangle) number |
private int[][] |
surfNode
nodes of a surface (int[surfNb][3]) |
private float[][] |
surfNormal
Normal to a Surface (SurfNormal[i][j] = j-th coordinate of i-th surface normal). |
private float[][][] |
toBarCo
Matrices to get the barycentric coordinates ([cellNb][3][3]): {l2,l3,l4} = toBarCo[cellId][][]. |
private float[][] |
xyz
nodes coordinates (xyz[i][j] = j-th coordinate of i-th node) |
Fields inherited from class spis.Vol.VolMesh.VolMesh |
|
Constructor Summary | |
ThreeDUnstructVolMesh(Geom geometry,
ThreeDUnstructSurfMesh boundarySurfMesh,
ThreeDUnstructSurfMesh scSurfMesh,
int cellNbr,
int surfNbr,
int edgeNbr,
int nodeNbr,
int[][] cellSurfs,
int[][] cellEdges,
int[][] cellNodes,
int[][] surfEdges,
int[][] surfNodes,
int[][] edgeNodes,
int[] surfFlags,
int[] surfIdSC,
int[] surfIdB,
int[] edgeFlags,
int[] edgeIdSC,
int[] edgeIdB,
int[] nodeFlags,
int[] nodeIdSC,
int[] nodeIdB,
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. |
private float[] |
cellBary(int cellId)
return the barycentre of a cell |
void |
computeBarCo(float[] barCo,
float x,
float y,
float z,
int cellNo)
Computes barycentric coordinates barCo from cartesian coordinates with origin at first tetrahedron point (x = xParticle - xPoint1) for a point (x, y, z) in cell cellNo. |
void |
computeGradient(PointList pl,
ScalVolField vf,
VectTable val)
Similar to Interpolate, but the gradient of a volume field is computed. |
void |
computeNormals()
Computes surface normals and makes a few checks. |
private void |
computeToBarCoMatrices()
Computes the matrix toBarCo transforming cartesian coordinates into barycentric coordinates. |
void |
currentDeposit(PartList pl,
VectVolField cur)
Performs the PIC deposit of current of the particle list pl in the current density cur. |
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 |
export()
exports the mesh(es) |
int[][] |
getCellEdge()
Returns the table of the edges of a cell (6 edges of the tetrahedron) |
int[][] |
getCellNode()
Returns the table of the nodes of a cell (4 points of the tetrahedron) |
int[][] |
getCellSurf()
Returns the table of the surfaces of a cell (4 triangles of the tetrahedron) |
float[] |
getCellVol()
Returns cell volumes |
ScalVolField |
getCellVolField()
Returns 'node volumes' |
int[] |
getEdgeFlag()
Returns the flags of the volume mesh edges |
int[] |
getEdgeIndexB()
Returns the boundary-surface indices of the volume mesh edges |
int[] |
getEdgeIndexSC()
Returns the SC-surface indices of the volume mesh edges |
float[] |
getEdgeLength()
Returns edges lengths |
int[][] |
getEdgeNode()
Returns the table of the nodes of an edge (2 points of an edge) |
int |
getElNb(Centring cent)
Provides the number of elements for a field with this centring (on nodes/cells/...). |
int |
getElNb(int relDim)
Returns the number of elements of relative dimension relDim |
int[] |
getExternNodeNumberingMap()
Returns the map of external node numbering. |
IntScalTable |
getInjectionCell(IntScalTable flagTable,
IntScalTable indexTable)
Returns the table of the cell indices of particles particles injected from boundaries. |
int[] |
getInternNodeNumberingMap()
Returns the map of internal node numbering. |
float[][] |
getNodeCoord()
Returns nodes coordinates |
int[] |
getNodeFlag()
Returns the flags of the volume mesh nodes |
int[] |
getNodeIndexB()
Returns the boundary-surface indices of the volume mesh nodes |
int[] |
getNodeIndexSC()
Returns the SC-surface indices of the volume mesh nodes |
float[] |
getNodeVol()
Returns 'node volumes' as a float array |
ScalVolField |
getNodeVolField()
Returns 'node volumes' as a volume field |
float[] |
getSurfArea()
Returns surface areas |
int[][] |
getSurfCell()
Returns the table of the cells surrounding a surface (2 tetrahedra, one on each side of a triangle) |
int[][] |
getSurfEdge()
Returns the table of the edges of a surface (3 edges of a triangle) |
int[] |
getSurfFlag()
Returns the flags of the volume mesh triangles |
int[] |
getSurfIndexB()
Returns the boundary-surface indices of the volume mesh triangles |
int[] |
getSurfIndexSC()
Returns the SC-surface indices of the volume mesh triangles |
int[][] |
getSurfNode()
Returns the table of the nodes of a surface (3 points of a triangle) |
float[][] |
getSurfNormal()
Returns surface normals |
float[][][] |
getToBarCo()
Returns the matrices to get the barycentric coordinates in each cell |
void |
initialise()
Performs extra mesh initialisations. |
void |
interpolate(PointList pl,
VolField vf,
Table val)
Interpolates the volume field vf (defined on the mesh nodes/cells/...) |
boolean |
isNodeRenumberingOn()
|
void |
mapToExternalNodeIndexing(float[] array)
Transforms an internal-node-number-indexed array of node-centered quantities to an external-node-number-indexed array on the spot (i.e. in the same array). |
void |
mapToExternalNodeIndexing(float[][] internIndexed,
float[][] externIndexed)
Maps node-centered quantities from an internal-node-number-indexed array to an external-node-number-indexed array. |
void |
mapToExternalNodeIndexing(float[] internIndexed,
float[] externIndexed)
Maps node-centered quantities from an internal-node-number-indexed array to an external-node-number-indexed array. |
void |
mapToInternalNodeIndexing(float[] array)
Transforms an external-node-number-indexed array of node-centered quantities to an internal-node-number-indexed array on the spot (i.e. in the same array). |
void |
mapToInternalNodeIndexing(float[][] externIndexed,
float[][] internIndexed)
Maps node-centered quantities from an external-node-number-indexed array to an internal-node-number-indexed array. |
void |
mapToInternalNodeIndexing(float[] externIndexed,
float[] internIndexed)
Maps node-centered quantities from an external-node-number-indexed array to an internal-node-number-indexed array. |
void |
mapToInternalNodeIndexing(int[] array)
Transforms an external-node-number-indexed array of node-centered integer quantities to an internal-node-number-indexed array on the spot (i.e. in the same array). |
void |
mapToInternalNodeIndexing(int[] externIndexed,
int[] internIndexed)
Maps integer node-centered quantities from an external-node-number-indexed array to an internal-node-number-indexed array. |
private void |
mapToSurf(FloatScalTable tIn,
FloatScalTable tOut,
int[] flag,
int[] index,
int mask)
maps table in to table out |
void |
mapToSurfField(ScalVolField fIn,
ScalSurfField fOut,
int flag)
Maps a volume field onto a surface fields. |
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. |
void |
samplePos(IntScalTable indexT,
SpaceVectTable posT)
Performs a random sampling of particle positions. |
void |
setInternNodeNumbering(int[] internNumbering)
Defines external to internal node numbering maps, external to internal maps, and renumbers node-indexed arrays with the internal numbering (for related surface meshes scsm and bsm too). |
void |
setNodeRenumbering(boolean b)
|
private float[] |
surfBary(int surfId)
return the barycentre of a surface |
Methods inherited from class spis.Vol.VolMesh.VolMesh |
eulerSolve, getBsm, getGeom, getScsm, getTotalVol, maxwellSolve, mhdSolve, setBsm, setScsm |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private ThreeDUnstructSurfMesh bsm
private ThreeDUnstructSurfMesh scsm
private int cellNb
private int surfNb
private int edgeNb
private int nodeNb
private int[][] cellSurf
private int[][] cellEdge
private int[][] cellNode
private int[][] surfEdge
private int[][] surfNode
private int[][] edgeNode
private int[][] surfCell
private int[] surfFlag
private int[] surfIndexSC
private int[] surfIndexB
private int[] edgeFlag
private int[] edgeIndexSC
private int[] edgeIndexB
private int[] nodeFlag
private int[] nodeIndexSC
private int[] nodeIndexB
private float[][] xyz
private float[] cellVol
private float[] surfArea
private float[] edgeLength
private float[] nodeVol
private float[][] surfNormal
private float[][][] toBarCo
private boolean nodeRenumbering
private int[] internNum
private int[] externNum
private int[] bufferNodeArrayI
private float[] bufferNodeArrayF
Constructor Detail |
public ThreeDUnstructVolMesh(Geom geometry, ThreeDUnstructSurfMesh boundarySurfMesh, ThreeDUnstructSurfMesh scSurfMesh, int cellNbr, int surfNbr, int edgeNbr, int nodeNbr, int[][] cellSurfs, int[][] cellEdges, int[][] cellNodes, int[][] surfEdges, int[][] surfNodes, int[][] edgeNodes, int[] surfFlags, int[] surfIdSC, int[] surfIdB, int[] edgeFlags, int[] edgeIdSC, int[] edgeIdB, int[] nodeFlags, int[] nodeIdSC, int[] nodeIdB, float[][] xyzCoord)
Method Detail |
public void initialise()
public void computeNormals()
private float[] cellBary(int cellId)
private float[] surfBary(int surfId)
private void computeToBarCoMatrices()
public void interpolate(PointList pl, VolField vf, Table val)
interpolate
in class VolMesh
public void computeGradient(PointList pl, ScalVolField vf, VectTable val)
computeGradient
in class VolMesh
VolMesh.interpolate(PointList, VolField, Table)
public void advance(PartList pl, VectTable dx)
advance
in class VolMesh
public void computeBarCo(float[] barCo, float x, float y, float z, int cellNo)
barCo
- outputx
- y
- z
- cellNo
- public void deposit(PartList pl, ScalVolField dens, int charge, int mass)
deposit
in class VolMesh
public void currentDeposit(PartList pl, VectVolField cur)
currentDeposit
in class VolMesh
public void poissonSolve(VectVolField E, ScalVolField dens, PoissonBC bc)
poissonSolve
in class VolMesh
public void samplePos(IntScalTable indexT, SpaceVectTable posT)
samplePos
in class VolMesh
indexT
- posT
- public void mapToInternalNodeIndexing(float[] externIndexed, float[] internIndexed)
mapToInternalNodeIndexing
in class VolMesh
public void mapToInternalNodeIndexing(int[] externIndexed, int[] internIndexed)
public void mapToInternalNodeIndexing(float[][] externIndexed, float[][] internIndexed)
mapToInternalNodeIndexing
in class VolMesh
public void mapToExternalNodeIndexing(float[] internIndexed, float[] externIndexed)
mapToExternalNodeIndexing
in class VolMesh
public void mapToExternalNodeIndexing(float[][] internIndexed, float[][] externIndexed)
mapToExternalNodeIndexing
in class VolMesh
public void mapToInternalNodeIndexing(float[] array)
public void mapToInternalNodeIndexing(int[] array)
public void mapToExternalNodeIndexing(float[] array)
public void setInternNodeNumbering(int[] internNumbering)
public float[] applyScalFunction(Centring centring, ScalFunctionOfVect f)
applyScalFunction
in class VolMesh
public float[][] applyVectFunction(Centring centring, VectFunctionOfVect f)
applyVectFunction
in class VolMesh
public void mapToSurfField(ScalVolField fIn, ScalSurfField fOut, int flag)
mapToSurfField
in class VolMesh
private void mapToSurf(FloatScalTable tIn, FloatScalTable tOut, int[] flag, int[] index, int mask)
public void export()
public IntScalTable getInjectionCell(IntScalTable flagTable, IntScalTable indexTable)
getInjectionCell
in class VolMesh
flagTable
- flag of the particles (on SC or on boundary, cf PartList)indexTable
- surface index for a particle on a surface mesh
public int[] getInternNodeNumberingMap()
public int[] getExternNodeNumberingMap()
public int getElNb(Centring cent)
getElNb
in class VolMesh
public int getElNb(int relDim)
getElNb
in class VolMesh
public int[][] getCellSurf()
public int[][] getCellEdge()
public int[][] getCellNode()
public int[][] getSurfEdge()
public int[][] getSurfNode()
public int[][] getEdgeNode()
public int[][] getSurfCell()
public int[] getSurfFlag()
public int[] getSurfIndexSC()
public int[] getSurfIndexB()
public int[] getEdgeFlag()
public int[] getEdgeIndexSC()
public int[] getEdgeIndexB()
public int[] getNodeFlag()
public int[] getNodeIndexSC()
public int[] getNodeIndexB()
public float[][] getNodeCoord()
public float[] getCellVol()
public ScalVolField getCellVolField()
getCellVolField
in class VolMesh
public float[] getSurfArea()
public float[] getEdgeLength()
public float[] getNodeVol()
public ScalVolField getNodeVolField()
getNodeVolField
in class VolMesh
public float[][] getSurfNormal()
public float[][][] getToBarCo()
public boolean isNodeRenumberingOn()
public void setNodeRenumbering(boolean b)
b
- true if node renumbering is on (defined by CutHill McKee renumbering)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |