|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectspis.Solver.Poisson.PoissonSolver
spis.Solver.Poisson.PotPoissonSolver
spis.Solver.Poisson.ConjGrad3DUnstructPoissonSolver
Class Name : ConjGrad3DUnstructPoissonSolver
Project ref : SPIS project
File name : ConjGrad3DUnstructPoissonSolver.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 : Poisson solving through pre-conditioned conjugate
gradient method.
Versions and anomalies correction :
Version number | Author (name, e-mail) | Corrections/Modifications |
0.1 | JF Roussel, roussel@onecert.fr and D Volpert, volpert@cert.fr | Creation |
Field Summary | |
private int[] |
bandTab
Matrices bandwith: bandTab[0] for preconditioning, bandTab[1] for Poisson matrix |
private int[] |
cellWire
if 0 node of cell i is wire, cellWire[i] = 0 if 1 and only 1 node of cell i is wire, cellWire[i] = 1+local number of this node if more than 1 node of cell i is wire, cellWire[i] < 0 |
private double[] |
densBuf
Buffer for density |
private double[] |
diagMass
Diagonal of the Mass matrix [nodeNb] |
private double[] |
diagPoisson
Diagonal of the poisson matrix [nodeNb] |
private int[] |
dirichletFlag
Dirichlet flag (it must be provided to the solver hence Dirichlet flag cannot be considered as a simple temporary buffer as fourierFlagBuf or other coeff and values |
private double[] |
dirichletPotBuf
Buffer for Dirichlet fixed potential |
private double[] |
fourierAlphaBuf
Buffer for Fourier alpha coefficient |
private int[] |
fourierFlagBuf
Buffer for Fourier flag |
private double[] |
fourierValueBuf
Buffer for Fourier non homogeneous value |
private int |
iterGradient
max iteration number for linear solver |
private int |
iterGradientNl
max iteration number for non-linear solver |
private int |
iterNewton
max iteration number for Newton iterations in non-linear solver |
private float[] |
lenNodeWire
lenNodeWire[i] is the distance of node i to the wire |
private double[] |
matMass
Mass matrix (without the diagonal) [ndimMat] |
private double[] |
matPoisson
Poisson matrix (without the diagonal) [ndimMat] |
private float[][] |
minusDrDn
minusDrDn[i][j] is -dr/dn of node j of surface i, where r is the distance to the wire and n the normal of the surface i (pointing to the wire) |
private int |
ndimMat
Number of non-zero out-of-diagonal element in this matrix profile |
private int[] |
nonZeroMat
First table to store the shape of non null elements in Poisson matrix: pointer to matrix row (nonZeroMat[i] is the first element of row i) |
private int[] |
pointMat
Second table to store the shape of non null elements in Poisson matrix: column index |
private double[] |
potBuf
Buffer for potential |
private double[] |
precondPoisson
Poisson pre-conditionner |
private double[] |
secMember
Second member in Poisson linear system [nodeNb] |
private double |
tolGradient
tolerance for linear solver |
private double |
tolGradientNl
tolerance for non-linear solver |
private double |
tolNewton
tolerance for Newton iterations in non-linear solver |
private ThreeDUnstructVolMesh |
vm
pointer to the 3D unstruct vol mesh (redundant with vm stored at parent class level but vm is stored as VolMesh and its sub-type information is lost, which is not the case here) |
private int[] |
wireEdge
wireEdge[i] is the index of the nearest edge of node i |
Fields inherited from class spis.Solver.Poisson.PoissonSolver |
bbc, bsm, elecDens, elecDens2, elecTemp, elecTemp2, linear, scbc, scsm |
Constructor Summary | |
ConjGrad3DUnstructPoissonSolver(ThreeDUnstructVolMesh volMesh)
Constructor with really minimum data, default boundary conditions will be: - Dirichlet on spacecraft (fixed potential) - Fourier at external boundaries (potentiel goes asymptotically to zero, within 1 meter) Default data for non-linear solving are: dens = 10^11 #/m3, Te = 0.1eV. |
|
ConjGrad3DUnstructPoissonSolver(ThreeDUnstructVolMesh volMesh,
float ne,
float Te,
float ne2,
float Te2,
boolean linear)
Constructor with little data, default boundary conditions will be: - Dirichlet on spacecraft (fixed potential) - Fourier at external boundaries (potentiel goes asymptotically to zero, within 1 meter with these pre-defined parameters) |
|
ConjGrad3DUnstructPoissonSolver(ThreeDUnstructVolMesh volMesh,
SurfMesh boundarySurfMesh,
SurfMesh scSurfMesh,
PoissonBC boundaryBC,
PoissonBC scBC,
float ne,
float Te,
float ne2,
float Te2,
boolean linear)
Default constructor |
Method Summary | |
private void |
buildBC(PoissonBC bc)
Updates buffered fourierFlagBuf, fourierAlphaBuf, fourierValueBuf, dirichletFlag, and dirichletPotBuf arrays from passed Poisson boundary condition |
void |
buildMatrices(int[] fourierFlag,
double[] fourierAlpha,
double[] fourierValue,
int[] dirFlag,
double[] dirichletPot)
Builds all matrices (and second member vectors) needed to later solve Poisson equation. |
int |
getIterGradient()
|
int |
getIterGradientNl()
|
int |
getIterNewton()
|
double |
getTolGradient()
|
double |
getTolGradientNl()
|
double |
getTolNewton()
|
void |
init()
Initialises solver, which should be done only once at solver creation. |
void |
initFromBc()
Builds all matrices (and second member vectors) needed to later solve Poisson equation, needed each time BC are modified. |
void |
interpolatePotential(PointList pl,
ScalVolField pot,
FloatScalTable val)
Interpolates the potential at each particle position: linear in regular tetrahedra, specific in tetrahedra next to a wire (contrarily to VolMesh interpolatePotential routine). |
void |
interpolatePotGradient(PointList pl,
ScalVolField pot,
VectTable val)
Computes the potential gradient (minus the electric field) at each particle position: linear in regular tetrahedra, specific in tetrahedra next to a wire (contrarily to VolMesh computeGradient(...) routine.) |
void |
setIterGradient(int i)
|
void |
setIterGradientNl(int i)
|
void |
setIterNewton(int i)
|
void |
setTolGradient(double d)
|
void |
setTolGradientNl(double d)
|
void |
setTolNewton(double d)
|
void |
solveLinear(ScalVolField density,
VectVolField E_)
Solves Poisson equation. |
void |
solveNonLinear(ScalVolField density,
VectVolField E_)
Solves non-linearPoisson equation. |
Methods inherited from class spis.Solver.Poisson.PotPoissonSolver |
getAnalyticDens |
Methods inherited from class spis.Solver.Poisson.PoissonSolver |
getBbc, getBsm, getElecDens, getElecDens2, getElecTemp, getElecTemp2, getScbc, getScsm, getVm, isLinear, setElecDens, setElecDens2, setElecTemp, setElecTemp2, setLinear, setScPot, solve |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private ThreeDUnstructVolMesh vm
private int[] nonZeroMat
private int[] pointMat
private int ndimMat
private int[] bandTab
private double[] diagMass
private double[] matMass
private double[] diagPoisson
private double[] matPoisson
private double[] secMember
private double[] precondPoisson
private int[] dirichletFlag
private int[] fourierFlagBuf
private double[] fourierAlphaBuf
private double[] fourierValueBuf
private double[] dirichletPotBuf
private double[] potBuf
private double[] densBuf
private int[] cellWire
private int[] wireEdge
private float[][] minusDrDn
private float[] lenNodeWire
private double tolGradient
private int iterGradient
private double tolGradientNl
private int iterGradientNl
private double tolNewton
private int iterNewton
Constructor Detail |
public ConjGrad3DUnstructPoissonSolver(ThreeDUnstructVolMesh volMesh, SurfMesh boundarySurfMesh, SurfMesh scSurfMesh, PoissonBC boundaryBC, PoissonBC scBC, float ne, float Te, float ne2, float Te2, boolean linear)
volMesh
- volume meshboundarySurfMesh
- external boundary surface meshscSurfMesh
- spacecraft surface meshboundaryBC
- boundary conditions on external boundaryscBC
- boundary conditions on spacecraftne
- reference electron density (for non linear Poisson solver)Te
- reference electron temperature (for non linear Poisson solver)linear
- if true, linear solver will be used by defaultpublic ConjGrad3DUnstructPoissonSolver(ThreeDUnstructVolMesh volMesh, float ne, float Te, float ne2, float Te2, boolean linear)
volMesh
- volume mesh (spacecraft and external boundary meshes are extracted from volMesh)ne
- reference electron density (for non linear Poisson solver)Te
- reference electron temperature (for non linear Poisson solver)linear
- linear solver selection by default?public ConjGrad3DUnstructPoissonSolver(ThreeDUnstructVolMesh volMesh)
volMesh
- volume mesh (spacecraft and external boundary meshes are extracted from volMesh)Method Detail |
public void init()
init
in class PoissonSolver
public void buildMatrices(int[] fourierFlag, double[] fourierAlpha, double[] fourierValue, int[] dirFlag, double[] dirichletPot)
public void initFromBc()
initFromBc
in class PoissonSolver
private void buildBC(PoissonBC bc)
public void solveNonLinear(ScalVolField density, VectVolField E_)
solveNonLinear
in class PoissonSolver
public void solveLinear(ScalVolField density, VectVolField E_)
solveLinear
in class PoissonSolver
public void interpolatePotGradient(PointList pl, ScalVolField pot, VectTable val)
interpolatePotGradient
in class PoissonSolver
pl
- particle list (points are enough)pot
- potential (input)val
- gradient at particle locationsPoissonInit.computeGradient(float[][], float[][], float[][], float[][], double[], float[], float[], float[], float[], int[], double[], int[][], int[][], int[][], int[][], int[][], int[][], int[], int[], int[], int[], int[], int, ThreeDUnstructVolMesh)
,
ThreeDUnstructVolMesh.computeGradient(PointList, ScalVolField, VectTable)
public void interpolatePotential(PointList pl, ScalVolField pot, FloatScalTable val)
interpolatePotential
in class PoissonSolver
pl
- particle list (points are enough)pot
- potential (input)val
- gradient at particle locationsPoissonInit.interpolatePotential(float[][], float[][], float[], double[], float[], float[], float[], int[], int[][], int[][], int[][], int[][], int[][], int[][], int[], int[], int[], int[], int[], int, ThreeDUnstructVolMesh)
,
ThreeDUnstructVolMesh.interpolate(PointList, VolField, Table)
public int getIterGradient()
public int getIterGradientNl()
public int getIterNewton()
public double getTolGradient()
public double getTolGradientNl()
public double getTolNewton()
public void setIterGradient(int i)
i
- public void setIterGradientNl(int i)
i
- public void setIterNewton(int i)
i
- public void setTolGradient(double d)
d
- public void setTolGradientNl(double d)
d
- public void setTolNewton(double d)
d
-
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |