|
1 | | -# partdiff |
| 1 | +# partdiff |
| 2 | + |
| 3 | +partdiff is an application to solve partial differential equations using the Gauß-Seidel and Jacobi methods. |
| 4 | + |
| 5 | +It is mainly used for teaching and research purposes. |
| 6 | + |
| 7 | +partdiff was originally created by Thomas Ludwig, Thomas A. Zochler, and Andreas C. Schmidt in Fortran and has since been ported to C. |
| 8 | + |
| 9 | +## Usage |
| 10 | + |
| 11 | +```shell |
| 12 | +$ git clone |
| 13 | +$ cd partdiff |
| 14 | +$ make |
| 15 | +$ ./partdiff |
| 16 | +Usage: ./partdiff [num] [method] [lines] [func] [term] [acc/iter] |
| 17 | + |
| 18 | + - num: number of threads (1 .. 1024) |
| 19 | + - method: calculation method (1 .. 2) |
| 20 | + 1: Gauß-Seidel |
| 21 | + 2: Jacobi |
| 22 | + - lines: number of interlines (0 .. 100000) |
| 23 | + matrixsize = (interlines * 8) + 9 |
| 24 | + - func: interference function (1 .. 2) |
| 25 | + 1: f(x,y) = 0 |
| 26 | + 2: f(x,y) = 2 * pi^2 * sin(pi * x) * sin(pi * y) |
| 27 | + - term: termination condition ( 1.. 2) |
| 28 | + 1: sufficient accuracy |
| 29 | + 2: number of iterations |
| 30 | + - acc/iter: depending on term: |
| 31 | + accuracy: 1e-4 .. 1e-20 |
| 32 | + iterations: 1 .. 200000 |
| 33 | + |
| 34 | +Example: ./partdiff 1 2 100 1 2 100 |
| 35 | + |
| 36 | +$ ./partdiff 1 2 100 1 2 100 |
| 37 | +Calculation time: 0.035731 s |
| 38 | +Memory usage: 9.986588 MiB |
| 39 | +Calculation method: Jacobi |
| 40 | +Interlines: 100 |
| 41 | +Inference function: f(x,y) = 0 |
| 42 | +Termination: Number of iterations |
| 43 | +Number iterations: 100 |
| 44 | +Residuum: 3.544251e-03 |
| 45 | + |
| 46 | +Matrix: |
| 47 | + 1.0000 0.8750 0.7500 0.6250 0.5000 0.3750 0.2500 0.1250 0.0000 |
| 48 | + 0.8750 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.1250 |
| 49 | + 0.7500 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.2500 |
| 50 | + 0.6250 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.3750 |
| 51 | + 0.5000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.5000 |
| 52 | + 0.3750 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.6250 |
| 53 | + 0.2500 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.7500 |
| 54 | + 0.1250 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.8750 |
| 55 | + 0.0000 0.1250 0.2500 0.3750 0.5000 0.6250 0.7500 0.8750 1.0000 |
| 56 | +``` |
| 57 | + |
| 58 | +## Regression testing |
| 59 | + |
| 60 | +We use [partdiff_tester](https://github.com/parcio/partdiff_tester) to perform automatic regression tests. |
0 commit comments