spis.Solver.Poisson
Class PoissonSolver

java.lang.Object
  extended byspis.Solver.Poisson.PoissonSolver
Direct Known Subclasses:
PotPoissonSolver

public abstract class PoissonSolver
extends java.lang.Object

Class Name : PoissonSolver (generic Poisson Solver)
Project ref : SPIS project
File name : PoissonSolver.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 Poisson Solver class.
Stores data necessary for Poisson equation solving:
- mesh data (possibly only throug reference to a volume mesh
- boundary conditions
- solver tuning parameters
Provides two main methods: initialisation and solving.

Versions and anomalies correction :

Version numberAuthor (name, e-mail) Corrections/Modifications
0.1 JF Roussel, roussel@onecert.frCreation


Version:
0.1
Author:
JF Roussel

Constructor Summary
PoissonSolver(VolMesh volMesh, SurfMesh boundarySurfMesh, SurfMesh scSurfMesh, PoissonBC boundaryBC, PoissonBC scBC, float ne, float Te, float ne2, float Te2, boolean linear_)
          Default constructor.
 
Method Summary
abstract  AnalyticVolDistrib getAnalyticDens(VectVolField E)
          Returns the analytic volume distribution the non-linear solver is based upon.
 PoissonBC getBbc()
          returns external Boundary Boundary Condition (pointer, no copy)
 SurfMesh getBsm()
          returns Boundary Surface Mesh (pointer, no copy)
 float getElecDens()
           
 float getElecDens2()
           
 float getElecTemp()
           
 float getElecTemp2()
           
 PoissonBC getScbc()
          returns SpaceCraft Boundary Condition (pointer, no copy)
 SurfMesh getScsm()
          returns SpaceCraft Surfave Mesh (pointer, no copy)
 VolMesh getVm()
          returns volume mesh (pointer, no copy)
abstract  void init()
          Initialises solver.
abstract  void initFromBc()
          Initialises internal data (matrices...), which have to be updated when new boundary conditions are modified (to be called each time BC are modified, including SC potential change, but should be done by the BC and potential updating methods of PoissonSolver classes)
abstract  void interpolatePotential(PointList pl, ScalVolField pot, FloatScalTable val)
          Interpolates the potential at each particle position: The interpolation should be specific to the solver and better than the generic linear interpolation provided by the VolMesh for a VolField.
abstract  void interpolatePotGradient(PointList pl, ScalVolField pot, VectTable val)
          Computes the potential gradient (minus the electric field) at each particle position.
 boolean isLinear()
           
 void setElecDens(float f)
           
 void setElecDens2(float f)
           
 void setElecTemp(float f)
           
 void setElecTemp2(float f)
           
 void setLinear(boolean b)
           
 void setScPot(ScalSurfField scPot)
          Sets the boundary condition on spacecraft to Dirichlet (fixed potential)
 void solve(ScalVolField density, VectVolField E)
          Default call to the solver.
abstract  void solveLinear(ScalVolField density, VectVolField E)
          Solves Poisson equation.
abstract  void solveNonLinear(ScalVolField density, VectVolField E)
          Solves non-linear Poisson equation (electron density = exp(pot/Te).
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PoissonSolver

public PoissonSolver(VolMesh volMesh,
                     SurfMesh boundarySurfMesh,
                     SurfMesh scSurfMesh,
                     PoissonBC boundaryBC,
                     PoissonBC scBC,
                     float ne,
                     float Te,
                     float ne2,
                     float Te2,
                     boolean linear_)
Default constructor. Checks consistensy of meshes and boundary conditions.

Method Detail

init

public abstract void init()
Initialises solver.
Depending on the method, it may assemble the matrix, etc.


initFromBc

public abstract void initFromBc()
Initialises internal data (matrices...), which have to be updated when new boundary conditions are modified (to be called each time BC are modified, including SC potential change, but should be done by the BC and potential updating methods of PoissonSolver classes)


solveLinear

public abstract void solveLinear(ScalVolField density,
                                 VectVolField E)
Solves Poisson equation.
The E field expected here is generic (VectVolField), but most Poisson solvers are expected to work on E fields stored as a potential (PotVectVolField). They must then override the solve method with a solve(PotVectVolField E), and the generic runtime error generated by the present solve(VectVolField E) will not show up if solve is invoked with a correct PotVectVolField E.
NB: the correct OO way of doing that would be enforce sub-types by defining Several different interfaces may be implemented to pass control parameters (precision, or iteration number, etc.), but this one, with no parameters (only E is passed), must be implemented so that the user can be sure to have this default interface (automated definition of default control parameters). Still TBC.


solveNonLinear

public abstract void solveNonLinear(ScalVolField density,
                                    VectVolField E)
Solves non-linear Poisson equation (electron density = exp(pot/Te).
The E field expected here is generic (VectVolField), but most Poisson solvers are expected to work on E fields stored as a potential (PotVectVolField). They must then override the solve method with a solve(PotVectVolField E), and the generic runtime error generated by the present solve(VectVolField E) will not show up if solve is invoked with a correct PotVectVolField E.
NB: the correct OO way of doing that would be enforce sub-types by defining Several different interfaces may be implemented to pass control parameters (precision, or iteration number, etc.), but this one, with no parameters (only E is passed), must be implemented so that the user can be sure to have this default interface (automated definition of default control parameters). Still TBC.


solve

public void solve(ScalVolField density,
                  VectVolField E)
Default call to the solver.
Selects the linear or non linear solver depending on the boolean switch 'linear' of this object.
The non-linear or linear resolution can still be enforced (in spite of the switch) by a call to solveLinear or SolveNonLinear.

Parameters:
density -
E -
See Also:
solveLinear(ScalVolField, VectVolField), solveNonLinear(ScalVolField, VectVolField)

interpolatePotGradient

public abstract void interpolatePotGradient(PointList pl,
                                            ScalVolField pot,
                                            VectTable val)
Computes the potential gradient (minus the electric field) at each particle position. The interpolation should be specific to the solver and better than the generic linear interpolation provided by the VolMesh for a VolField.

Parameters:
pl - particle list (points are enough)
pot - optential (input)
val - gradient at particle locations
See Also:
VolMesh.computeGradient(PointList, ScalVolField, VectTable)

interpolatePotential

public abstract void interpolatePotential(PointList pl,
                                          ScalVolField pot,
                                          FloatScalTable val)
Interpolates the potential at each particle position: The interpolation should be specific to the solver and better than the generic linear interpolation provided by the VolMesh for a VolField.

Parameters:
pl - particle list (points are enough)
pot - potential (input)
val - gradient at particle locations
See Also:
VolMesh.interpolate(PointList, VolField, Table)

getAnalyticDens

public abstract AnalyticVolDistrib getAnalyticDens(VectVolField E)
Returns the analytic volume distribution the non-linear solver is based upon.
For now it can only be a GlobalMaxwellBoltzmannVolDistrib (Maxwell-Boltzman indeed) and this routine is implemented here.
In the future an arbitrary analytic distribution may be takent into account by non linear solver (different distribution than Boltzman), with the following changes:
- a new constructor with an AnalyticVolDistrib instead of ne and Te for PoissonSolvers - this routine to be modifed to return the generic AnalyticVolDistrib instead of the current GlobalMaxwellBoltzmannVolDistrib

Parameters:
E - pointer to the electric field to be used for this analytic distribution

setScPot

public void setScPot(ScalSurfField scPot)
Sets the boundary condition on spacecraft to Dirichlet (fixed potential)

Parameters:
scPot - the fixed potenial value

getVm

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


getBsm

public SurfMesh getBsm()
returns Boundary Surface Mesh (pointer, no copy)


getScsm

public SurfMesh getScsm()
returns SpaceCraft Surfave Mesh (pointer, no copy)


getBbc

public PoissonBC getBbc()
returns external Boundary Boundary Condition (pointer, no copy)


getScbc

public PoissonBC getScbc()
returns SpaceCraft Boundary Condition (pointer, no copy)


getElecDens

public float getElecDens()
Returns:

getElecTemp

public float getElecTemp()
Returns:

isLinear

public boolean isLinear()
Returns:

setElecDens

public void setElecDens(float f)
Parameters:
f -

setElecTemp

public void setElecTemp(float f)
Parameters:
f -

setLinear

public void setLinear(boolean b)
Parameters:
b -

getElecDens2

public float getElecDens2()
Returns:

getElecTemp2

public float getElecTemp2()
Returns:

setElecDens2

public void setElecDens2(float f)
Parameters:
f -

setElecTemp2

public void setElecTemp2(float f)
Parameters:
f -