Some initial experiments with Fortran OO and PDEs
What is openpde? | Main features | Copyrights | Download | Compilation | Documentation
To be written.
Go to Top
To be written.
Go to Top
openpde is an open source project, it is distributed under a multi-licensing system:
- for FOSS projects:
- for closed source/commercial projects:
Anyone is interest to use, to develop or to contribute to openpde is welcome, feel free to select the license that best matches your soul!
More details can be found on wiki.
Openpde relies on some third party codes each having its own licence. See them for details:
Go to Top
Openpde home is at https://github.com/francescosalvadore/openpde. It uses git submodule
to handle third party dependencies. To download all the source files you can:
git clone --recursive https://github.com/francescosalvadore/openpde
git submodule update --init --recursive
https://github.com/francescosalvadore/openpde/archive/master.zip
https://github.com/francescosalvadore/openpde/releases
Go to Top
Openpde is still under development phase: the sources change often and strongly, it being still in alpha test. As as consequence, an inflexible legacy makefile is not yet provided. To build the unstable library you must use the more practical FoBiS.py building tool.
To build all tests provided type
FoBiS.py build -mode tests-gnu # build test with GNU gfortran
# or
FoBiS.py build -mode tests-gnu-debug # build test with GNU gfortran with debug options
# or
FoBiS.py build -mode tests-intel # build test with Intel Fortran
# or
FoBiS.py build -mode tests-intel-debug # build test with Intel Fortran with debug options
To build only a specific test, e.g. burgers
one, type
FoBiS.py build -mode tests-gnu -t burgers.f90
You can also specify all other modes listed above.
To build the static linked library type
FoBiS.py build -mode opendiff-static-gnu # build library with GNU gfortran
# or
FoBiS.py build -mode opendiff-static-gnu-debug # build library with GNU gfortran with debug options
# or
FoBiS.py build -mode opendiff-static-intel # build library with Intel Fortran
# or
FoBiS.py build -mode opendiff-static-intel-debug # build library with Intel Fortran with debug options
Go to Top
Note that Besides this README file openpde's documentation is contained into its own wiki. Detailed documentation of the API is contained into the GitHub Pages that can also be created locally by means of ford tool.
Openpde's design is strongly based on abstract and concrete classes: each key-feature of PDEs is represented by a class family, namely an abstract class and (some of) its concrete extensions, that provides all the behaviorual methods to describe the PDE and to integrate it in space and time. In particular, PDEs are generally constituted by a (complex) mixture of the following ingredients:
- one or more integrand fields, e.g. density, momentum and energy are the integrand field of the Euler's PDE;
- one or more spatial operators operating on the fields that concur to define the residual function (or the whole spatial operator) of the PDE, e.g. the divergence of the conservative fluxes of density, momentum and energy is the spatial operator of the Euler's PDE; these must have both an exact definition and a numerical approximation;
- a discrete representation of the integrand-spatial-domain, that is general indicated as mesh;
- an integrator, that by means of a numerical approximation of the residual function can compute a (numerical approximation) new field solution at the new time.
Openpde takes care to define an abstract class for each key-ingredients and it also provides all the concrete counterparts to solve numerically the PDE: the users must only define their own PDE equation by means of the defined operators.
The project tree is the following:
.
├── doc
│ └── ...
├── src
│ ├── lib
│ ├── tests
│ └── third_party
├── third_party
│ └── ...
├── tools
│ └── ...
...
doc
contains the files necessary to build the API documentation;src
contains source files necessary to build the library and the tests;third_party
contains third party repositories as git submodules;tools
contains auxiliary tools, e.g. post-processing scripts.
The src
tree structure is the following:
src/
├── lib
│ ├── openpde.f90
│ ├── openpde_kinds.f90
│ ├── openpde_equation
│ │ └── ...
│ ├── openpde_field
│ │ └── ...
│ ├── openpde_integrator
│ │ └── ...
│ ├── openpde_mesh
│ │ └── ...
│ └── openpde_spatial_operator
│ └── ...
├── tests
│ └── ...
└── third_party
├── json-fortran
│ ├── json_file_module.F90 -> ../../../third_party/json-fortran/src/json_file_module.F90
│ └── ...
├── VTKFortran
│ ├── befor64.F90 -> ../../../third_party/VTKFortran/src/lib/befor64.F90
│ └── ...
└── ...
src/lib
contains the openpde library sources;src/tests
contains the openpde tests sources;src/third_party
contains the link to third party sources.
Openpde is based on some abstract classes:
- mesh, abstract and concrete classes;
- field, abstract and concrete classes;
- spatial operator, abstract and concrete classes;
- equation, only abstract class;
- integrator, abstract and concrete classes;
Essentially, the openpde's design should allow two different workflows for the library developers and for the library users:
- developers: could modify/create all classes;
- users: should modify/create only concrete extensions of equation abstract class.
In the following a short description of the classes meaning is provided.
The abstract mesh represents the most generic mesh
in the sense of PDE numerical integration (in space and time). Essentially, this object is empty: how to store mesh data and how to use it are left to concrete extensions of the abstract mesh
. Currently, openpde provides the following concrete meshes:
The concrete class mesh_FD_1D/2D
is designed to represent a finite difference, 1D/2D mesh: it is uniform, one/two dimensional discretization of the integration domain. To handle boundary conditions, ghost cells technique is exploited. The data provided by this object are used by the field and spatial operators.
The abstract field represents the most generic field
in the sense of PDE integrand (in space and time). Essentially, this object ships a pointer to the associated underling mesh
and a far complete set of operators to combine fields and fields/reals. As a matter of facts, PDEs commonly involve some algebra on integrand fields.
The field value (into the whole mesh) is left to the concrete extensions of the abstract field
. Currently, openpde provides the following concrete fields:
The concrete class field_FD_1D/2D
is designed to represent a field of a finite difference, 1D/2D mesh. Consequently, its value is stored for each mesh points. The applicable spatial operators are those of the finite difference 1D/2D classes (i.e. spatial_operator_xxx_FD_1D/2D
classes).
The abstract equation contains the necessary data to express the PDE equation. Essentially, it is an object that provide the method forcing
that compute the residual function of the PDE. This class is necessary by the time integrators for advance in time the PDE solution. The forcing
method operates on a field
class and returns a (forced by the residual function) field.
To be completed.
Go to Top