README.md

Thu, 26 Feb 2026 09:32:12 -0500

author
Tuomo Valkonen <tuomov@iki.fi>
date
Thu, 26 Feb 2026 09:32:12 -0500
changeset 1
a4137aedcb3a
child 3
c3a4f4bb87f7
permissions
-rw-r--r--

Initial working version for known convectivity and diffusivity

1
a4137aedcb3a Initial working version for known convectivity and diffusivity
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
1
a4137aedcb3a Initial working version for known convectivity and diffusivity
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
2 # Pointsource-PDE
a4137aedcb3a Initial working version for known convectivity and diffusivity
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
3
a4137aedcb3a Initial working version for known convectivity and diffusivity
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
4 ## Prerequisites
a4137aedcb3a Initial working version for known convectivity and diffusivity
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
5
a4137aedcb3a Initial working version for known convectivity and diffusivity
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
6 ## Installation and usage
a4137aedcb3a Initial working version for known convectivity and diffusivity
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
7
a4137aedcb3a Initial working version for known convectivity and diffusivity
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
8 ### Installing dependencies
a4137aedcb3a Initial working version for known convectivity and diffusivity
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
9
a4137aedcb3a Initial working version for known convectivity and diffusivity
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
10 Python dependencies are managed Conda and by the Cargo build system of [Rust].
a4137aedcb3a Initial working version for known convectivity and diffusivity
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
11 On some platforms, you can use alternative methods.
a4137aedcb3a Initial working version for known convectivity and diffusivity
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
12
a4137aedcb3a Initial working version for known convectivity and diffusivity
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
13 #### Phase 1: Python
a4137aedcb3a Initial working version for known convectivity and diffusivity
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
14
a4137aedcb3a Initial working version for known convectivity and diffusivity
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
15 ##### Most platforms:
a4137aedcb3a Initial working version for known convectivity and diffusivity
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
16
a4137aedcb3a Initial working version for known convectivity and diffusivity
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
17 - Fenicsx installed in Conda according to instructions
a4137aedcb3a Initial working version for known convectivity and diffusivity
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
18 - SciFEM and SciPY (`conda install conda-forge::scifem conda-forge::scipy`)
a4137aedcb3a Initial working version for known convectivity and diffusivity
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
19
a4137aedcb3a Initial working version for known convectivity and diffusivity
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
20 ##### Debian/Ubuntu
a4137aedcb3a Initial working version for known convectivity and diffusivity
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
21
a4137aedcb3a Initial working version for known convectivity and diffusivity
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
22 You may br able to use the system package manager instead of Conda, but beware of obsolete versions.
a4137aedcb3a Initial working version for known convectivity and diffusivity
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
23
a4137aedcb3a Initial working version for known convectivity and diffusivity
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
24 #### Phase 2: Rust
a4137aedcb3a Initial working version for known convectivity and diffusivity
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
25
a4137aedcb3a Initial working version for known convectivity and diffusivity
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
26 You will only need to install the “nightly” Rust compiler and the
a4137aedcb3a Initial working version for known convectivity and diffusivity
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
27 [GNU Scientific Library] manually. At the time of writing this README,
a4137aedcb3a Initial working version for known convectivity and diffusivity
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
28 [alg_tools] also needs to be downloaded separately.
a4137aedcb3a Initial working version for known convectivity and diffusivity
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
29
a4137aedcb3a Initial working version for known convectivity and diffusivity
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
30 1. Install the [Rust] infrastructure (including Cargo) with [rustup].
a4137aedcb3a Initial working version for known convectivity and diffusivity
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
31 2. Install a “nightly” release of the Rust compiler. With rustup, installed in
a4137aedcb3a Initial working version for known convectivity and diffusivity
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
32 the previous step, this can be done with
a4137aedcb3a Initial working version for known convectivity and diffusivity
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
33 ```console
a4137aedcb3a Initial working version for known convectivity and diffusivity
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
34 rustup toolchain install nightly
a4137aedcb3a Initial working version for known convectivity and diffusivity
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
35 ```
a4137aedcb3a Initial working version for known convectivity and diffusivity
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
36 3. Install [GNU Scientific Library]. On a Mac with [Homebrew] installed,
a4137aedcb3a Initial working version for known convectivity and diffusivity
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
37 this can be done with
a4137aedcb3a Initial working version for known convectivity and diffusivity
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
38 ```console
a4137aedcb3a Initial working version for known convectivity and diffusivity
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
39 brew install gsl
a4137aedcb3a Initial working version for known convectivity and diffusivity
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
40 ```
a4137aedcb3a Initial working version for known convectivity and diffusivity
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
41 For other operating systems, suggestions are available in the [rust-GSL]
a4137aedcb3a Initial working version for known convectivity and diffusivity
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
42 crate documentation. If not correctly installed, you may need to pass
a4137aedcb3a Initial working version for known convectivity and diffusivity
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
43 extra `RUSTFLAGS` options to Cargo in the following steps to locate the
a4137aedcb3a Initial working version for known convectivity and diffusivity
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
44 library.
a4137aedcb3a Initial working version for known convectivity and diffusivity
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
45
a4137aedcb3a Initial working version for known convectivity and diffusivity
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
46 4. Download [alg_tools] and unpack it under the same directory as this
a4137aedcb3a Initial working version for known convectivity and diffusivity
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
47 package.
a4137aedcb3a Initial working version for known convectivity and diffusivity
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
48
a4137aedcb3a Initial working version for known convectivity and diffusivity
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
49 [rustup]: https://rustup.rs
a4137aedcb3a Initial working version for known convectivity and diffusivity
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
50 [alg_tools]: https://tuomov.iki.fi/software/alg_tools/
a4137aedcb3a Initial working version for known convectivity and diffusivity
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
51 [Rust]: https://www.rust-lang.org/
a4137aedcb3a Initial working version for known convectivity and diffusivity
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
52 [GNU Scientific Library]: https://www.gnu.org/software/gsl/
a4137aedcb3a Initial working version for known convectivity and diffusivity
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
53 [rust-GSL]: https://docs.rs/GSL/6.0.0/rgsl/
a4137aedcb3a Initial working version for known convectivity and diffusivity
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
54 [Homebrew]: https://brew.sh
a4137aedcb3a Initial working version for known convectivity and diffusivity
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
55 [arXiv:2212.02991]: https://arxiv.org/abs/2212.02991
a4137aedcb3a Initial working version for known convectivity and diffusivity
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
56 [arXiv:2502.12417]: https://arxiv.org/abs/2502.12417
a4137aedcb3a Initial working version for known convectivity and diffusivity
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
57 [doi:10.46298/jnsao-2023-10433]: http://doi.org/10.46298/jnsao-2023-10433
a4137aedcb3a Initial working version for known convectivity and diffusivity
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
58
a4137aedcb3a Initial working version for known convectivity and diffusivity
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
59 ### Building and running the experiments
a4137aedcb3a Initial working version for known convectivity and diffusivity
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
60
a4137aedcb3a Initial working version for known convectivity and diffusivity
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
61 To compile and install the program, use
a4137aedcb3a Initial working version for known convectivity and diffusivity
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
62 ```console
a4137aedcb3a Initial working version for known convectivity and diffusivity
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
63 cargo install --path=.
a4137aedcb3a Initial working version for known convectivity and diffusivity
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
64 ```
a4137aedcb3a Initial working version for known convectivity and diffusivity
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
65 When doing this for the first time, several dependencies will be downloaded.
a4137aedcb3a Initial working version for known convectivity and diffusivity
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
66 Now you can run the default set of experiments with
a4137aedcb3a Initial working version for known convectivity and diffusivity
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
67 ```
a4137aedcb3a Initial working version for known convectivity and diffusivity
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
68 pointsource_pde -o results
a4137aedcb3a Initial working version for known convectivity and diffusivity
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
69 ```
a4137aedcb3a Initial working version for known convectivity and diffusivity
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
70 The `-o results` option tells `pointsource_pde` to write results in the
a4137aedcb3a Initial working version for known convectivity and diffusivity
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
71 `results` directory. The option is required.
a4137aedcb3a Initial working version for known convectivity and diffusivity
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
72
a4137aedcb3a Initial working version for known convectivity and diffusivity
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
73 Alternatively, you may build and run the program without installing with
a4137aedcb3a Initial working version for known convectivity and diffusivity
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
74 ```console
a4137aedcb3a Initial working version for known convectivity and diffusivity
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
75 cargo run --release -- -o results
a4137aedcb3a Initial working version for known convectivity and diffusivity
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
76 ```
a4137aedcb3a Initial working version for known convectivity and diffusivity
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
77 The double-dash separates the options for the Cargo build system
a4137aedcb3a Initial working version for known convectivity and diffusivity
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
78 and `pointsource_pde`.
a4137aedcb3a Initial working version for known convectivity and diffusivity
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
79
a4137aedcb3a Initial working version for known convectivity and diffusivity
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
80 ### Documentation
a4137aedcb3a Initial working version for known convectivity and diffusivity
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
81
a4137aedcb3a Initial working version for known convectivity and diffusivity
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
82 Use the `--help` option to get an extensive listing of command line options to
a4137aedcb3a Initial working version for known convectivity and diffusivity
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
83 customise algorithm parameters and the experiments performed.
a4137aedcb3a Initial working version for known convectivity and diffusivity
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
84
a4137aedcb3a Initial working version for known convectivity and diffusivity
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
85 ## Internals
a4137aedcb3a Initial working version for known convectivity and diffusivity
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
86
a4137aedcb3a Initial working version for known convectivity and diffusivity
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
87 If you are interested in the program internals, the integrated source code
a4137aedcb3a Initial working version for known convectivity and diffusivity
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
88 documentation may be built and opened with
a4137aedcb3a Initial working version for known convectivity and diffusivity
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
89 ```console
a4137aedcb3a Initial working version for known convectivity and diffusivity
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
90 cargo doc # build dependency docs
a4137aedcb3a Initial working version for known convectivity and diffusivity
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
91 misc/cargo-d --open # build and open KaTeX-aware docs for this crate
a4137aedcb3a Initial working version for known convectivity and diffusivity
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
92 ```
a4137aedcb3a Initial working version for known convectivity and diffusivity
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
93 The `cargo-d` script ensures that KaTeX mathematics is rendered in the
a4137aedcb3a Initial working version for known convectivity and diffusivity
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
94 generated documentation through an ugly workaround. Unfortunately,
a4137aedcb3a Initial working version for known convectivity and diffusivity
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
95 `rustdoc`, akin to Rust largely itself, is stuck in 80's 7-bit gringo ASCII
a4137aedcb3a Initial working version for known convectivity and diffusivity
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
96 world, and does not support modern markdown features, such as mathematics.

mercurial