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.,

\[\begin{split}\left[{\begin{array}{cc}A_{00}&A_{01}\\A_{10}&A_{11}\\\end{array}}\right]\left[{\begin{array}{cc}F_{1}\\G_{1}\\\end{array}}\right]=\left[\begin{array}{cc}F_{2}\\G_{2}\\\end{array}\right].\end{split}\]

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 jth readField 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 jth writeField 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>