Add `factorise` to lock_exchange.cpp example

Open Beginner friendly
#464 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
84/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Active
Tech stack
cpp
Domain
hpc

Research direction

Open lock_exchange.cpp and inspect how the sparse system is currently solved across repeated steps. Use the requested Armadillo factoriser setup and solve flow as the starting point, then run the example with the higher-resolution parameters given in the issue; done means the example completes and renders the billows.

Written by the indexing model from the issue text.

Description

C++ Enhancement Examples

Is your feature request related to a problem? Please describe.
When solving a system, if the LHS does not change, there are mechanisms to reuse the factorization. In Armadillo, this is achieved with factorise.

Describe the solution you'd like
Implement factorise in the lock_exchange.cpp example. This will let users run a higher resolution in the example, which will render the billows.

  // Factorizer for the sparse solve, Armadillo
  spsolve_factoriser SF;
  
  // L is a pure-Neumann Laplacian, singular to working precision (constants are
  // in its null space); factorise() rejects it unless allow_ugly is set.
  superlu_opts opts;
  opts.allow_ugly = true;
  bool status = SF.factorise(L, opts);

  ...
  bool solution1_ok = SF.solve(p_vec, b);
    
  if(solution1_ok == false) { cout << "couldn't find pvec" << endl; } 

Here is an example with b=50, d=5, m=800, n=160, dt=0.1.

Image

Keep-open request

  • I am requesting maintainer review for keep-open.

Reason:

Dominant language
MATLAB
Stars
41
Forks
85
Avg merge
1d 19h
Merged PRs (30d)
8

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from csrc-sdsu/mole

All issues in csrc-sdsu/mole

Similar issues

More MATLAB issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.