FIDELIOR
=======

**FIDELIOR** (_latin_: more reliable) stands for **FInite-Difference-Equation LInear OperatoR package**.

The purpose of _FIDELIOR_ is to help with numerical solution of **partial differential equations (PDE)**. In order to obtain a numerical solution, continuous functions and differential operators that enter a PDE are discretized. There are two main approaches to such discretization: the **finite-difference (FD) method** and the **finite-element method (FEM)**. The main idea of the FD approach is to represent various differential operators entering the PDE as _finite differences_. A linear PDE is represented as a linear system L**u** = **f**, where matrix L represents the action of a differential operator, vector **u** is the discretized unknown function, and **f** is the discretized inhomogeneous part. In FEM, the differential operators do not have to be supplied by the user; the FD equations emerge by writing the PDE in the _weak form_. Obtaining the discretized equation in FEM may be cumbersome. To help with discretization, there is an excellent Python package [FEniCS](https://fenicsproject.org) which allows the user to automate the generation of linear systems (such as one given above) from the weak forms. FEniCS provides much flexibility with finite element choice, and thus is a rather large project. The present package, _FIDELIOR_, strives to do for the FD method the same that FEniCS does for FEM, namely to provide flexibility and convenience in setting up the FD schemes. The user must have the knowledge of how the differential operators are discretized. Some help, however, is provided with [automatic](https://gitlab.com/nleht/fidelior/-/tree/master/old/src/fidelior/autoschemes.py) generation of FD schemes _(**NOTE**: this was done for the old interface, and I am in the process of rewriting it!)_. In case of a time-dependent PDE, the user must also provide the time-stepping scheme. We should point out that the **stability** of a time-stepping scheme is not guaranteed even in the FEM method, and this process is not automated even in FEniCS.

The _FIDELIOR_ package has undergone some changes from the [previous version](https://gitlab.com/nleht/fidelior/-/releases/v0.6). The most important change was to introduce a better and simpler interface, which allows much more flexibility in setting up complicated boundary conditions and other constraints. Some of the new interface, e.g., the use of `==` operator for setting up equations, was inspired by FEniCS. At the same time, the code became shorter, as some non-essential features were dropped. However, the functionality of the package did not suffer.

A good introduction to FD methods may be found, e.g., in
* Randall J. LeVeque (2007), _Finite Difference Methods for Ordinary and Partial Differential Equations_, SIAM, Philadelphia.

_FIDELIOR_ project requires Python3, NumPy and SciPy and, for plotting, Matplotlib.

In summary, _FIDELIOR_ allows the user
1. to represent functions as discretized values on a rectangular grid;
2. to represent differential operators as finite-difference operators;
3. to specify constraints (boundary conditions) on discretized functions;
4. to represent linear PDE as linear equations and solve them, taking into account the given constraints.

# Where to start

Introductory information about capabilites of _FIDELIOR_ is given in [this directory](https://gitlab.com/nleht/fidelior/-/tree/master/doc/). Some of the capabilities are demonstrated by the [included examples](https://gitlab.com/nleht/fidelior/-/tree/master/examples/).

# License

[![License: CC BY-ND 4.0](https://img.shields.io/badge/License-CC_BY--ND_4.0-lightgrey.svg)](https://creativecommons.org/licenses/by-nd/4.0/)

The project is free to use, however, it is protected by copyright. If you would like to use it in your publication, please cite the project webpage (https://gitlab.com/nleht/fidelior). A journal article is in preparation, and when it is available, it will have to be cited. If you have any suggestions for improvement (new features, bug fixes, etc.) please contact the the author, [Nikolai G. Lehtinen](https://gitlab.com/nleht), at ![his email address](https://gitlab.com/nleht/fidelior/-/raw/master/email.png).

# Older versions

See also the [previous interface version](https://gitlab.com/nleht/fidelior/-/tree/master/old/src/fidelior) and the [demonstration of some of its capabilities](https://gitlab.com/nleht/fidelior/-/tree/master/old/examples). Some of the examples [were converted to the new interface](https://gitlab.com/nleht/fidelior/-/tree/master/examples), others are in the process of such conversion.

The former location of the project was [here](https://gitlab.uib.no/BCSS-Q4/TRUMP) and then [here](https://git.app.uib.no/Nikolai.Lehtinen/TRUMP).

