- linearSolveUpdater
linearSolveUpdater
Works with VSimBase, VSimEM, VSimPD, VSimPA, and VSimVE licenses.
Multifield updater that works by defining a matrix relationship, \(Ax=b\), between two vectors, \(x\) and \(b\), and the matrix \(A\), e.g.,
linearSolveUpdater Parameters
The linearSolveUpdater
takes the lowerBounds
and
upperBounds
parameters of FieldUpdater, as well as
the following parameters:
- readFields (required string vector)
A vector containing the names of fields to read. If multiple components of a field are read, then the field name must be repeated once for each component.
- readComponents (required integer vector)
For each
readField
, a component; references to the jthreadField
will use the component specified in the jth element of this vector.
- writeFields (required string vector)
A vector containing the names of fields to update. If multiple components of a field are written, then the field name must be repeated once for each component.
- writeComponents (required integer vector)
For each
writeField
, a component; references to the jthwriteField
will use the component specified in the jth element of this vector.
- writeEquationToFile (optional integer, default = 0 (false))
The matrix \(A\), right-hand side vector \(b\), and (after solution) unknown vector \(x\), will be written out in MatrixMarket format when set to
true
.
MatrixFiller (required parameter block):
To define the matrix
A
, you must use a matrixFiller block. At least one matrixFiller block is required for the linearSolveUpdater.
VectorWriter (required parameter block):
To define the right-hand side vector
b
, you must use a VectorWriter block. At least one VectorWriter block is required for the linearSolveUpdater.
VectorReader (required parameter block):
To access the unknown vector
x
, you must use a VectorReader block. At least one VectorReader block is required for the linearSolveUpdater.
LinearSolver (required parameter block):
To solve the equation, you must use a LinearSolver block.
Example linearSolveUpdater Block
<FieldUpdater eyUpdate>
kind = linearSolveUpdater
lowerBounds = [0 0 0]
upperBounds = [NX NY NZ]
readFields = [edgeElec faceMag faceMag]
readComponents = [1 2 0] # 0 = Ey, 1 = Bz, 2 = Bx
writeFields = [edgeElec]
writeComponents = [1]
<MatrixFiller eyupmat>
kind = interior
<StencilElement eyey>
value = 1.
minDim = 0
cellOffset = [0 0 0]
rowFieldIndex = 0
columnFieldIndex = 0
</StencilElement>
<StencilElement eybxup>
...
</StencilElement>
...
</MatrixFiller>
<VectorWriter eyuprhs>
kind = fieldVectorWriter
minDim = 0
readField = faceMag
readComponent = 2
lowerBounds = [0 0 0]
upperBounds = [NX NY NZ]
component = 1
</VectorWriter>
<VectorReader eyupunk>
kind = fieldVectorReader
minDim = 0
writeField = edgeElec
writeComponent = 1
lowerBounds = [0 0 0]
upperBounds = [NX NY NZ]
</VectorReader>
<LinearSolver mySolver>
kind = iterativeSolver
<BaseSolver>
kind = gmres
</BaseSolver>
<Preconditioner>
kind = multigrid
mgDefaults = SA
</Preconditioner>
tolerance = 1.e-10
maxIterations = 1000
output = 1
</LinearSolver>
</FieldUpdater>