Skip to content

Sparse MOLE.jl operators #427

Description

@valeriabarra

Some of the current operator-returning functions in MOLE.jl have been implemented using dense storage, rather than sparse.

We need to update these operators to take advantage of the sparsity and reduce the memory footprint.

We want to use sparse storage initializers, such as: spzeros, sparse(I, ...), sparse kron, and sparse concatenation.

Here is the list of operators to be updated:

  1. Gradient operators
  • gradNonPeriodic
  • gradPeriodic
  • gradNonUniform
  • 2D grad(...), gradNonPeriodic(...), gradPeriodic(...), gradNonUniform(...)

These, right now, use dense zeros, Matrix(I, ...), diagm, kron, and dense concatenation.

  1. Divergence operators
  • divNonPeriodic
  • divPeriodic
  • divNonUniform
  • 2D div(...), div2DNonUniform(...)

These also use dense zeros, Matrix(I, ...), diagm, kron, and dense concatenation.

  1. Laplacian operators
  • 1D lap(...)
  • 2D lap(...)

These are products of D * G, so they will become sparse once div and grad return sparse matrices.

  1. Interpolator
  • interpol(m, c)

It imports SparseArrays but still allocates I = zeros(n_rows, n_cols), so it should also be changed to sparse storage.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions