docs: add TUG Julia package README.md

This commit is contained in:
nebmit 2024-01-10 19:04:04 +01:00
parent da65b6fa14
commit bd288e00e1
No known key found for this signature in database

88
julia/TUG/README.md Normal file
View File

@ -0,0 +1,88 @@
# TUG: Transport on Uniform Grids for Julia
## Overview
The TUG Julia package is a port of the same-named C++ library.
## Prerequisites
Before installing TUG, ensure you have Julia installed on your system. Julia can be downloaded and installed from [the official Julia website](https://julialang.org/downloads/).
## Installation
To install the TUG package locally, follow these steps in the Julia REPL (Read-Eval-Print Loop):
1. **Open Julia REPL**: You can start it by executing `julia` in your command line.
2. **Enter Pkg mode**: Press `]` to enter Pkg mode, which is Julia's package manager.
3. **Develop the Package Locally**:
```julia
(v1.x) pkg> develop path/to/tug/julia/TUG # Replace with the actual path to your TUG directory
```
4. **Exit Pkg mode**: Press `backspace` to exit Pkg mode.
5. **Use the Package**:
```julia
julia> using TUG
```
## Building the Documentation
To build the documentation for TUG:
1. **Navigate to the `docs` Directory**:
```shell
cd path/to/tug/julia/TUG/docs
```
2. **Build the Documentation**:
```shell
julia make.jl
```
## Running Tests
To run the tests for TUG, follow these steps:
1. **Navigate to the TUG Package Directory**:
```shell
cd path/to/tug/julia/TUG
```
2. **Enter Pkg mode and run the tests**:
```julia
(v1.x) pkg> test TUG
```
## Getting Started
To get started with TUG:
### Creating a Simulation
```julia
# Import the TUG package
using TUG
# Create a grid
grid = TUG.Grid{Float64}(5, ones(1, 5))
# Define boundary conditions
boundary = TUG.Boundary{Float64}(grid)
# Initialize a simulation
simulation = TUG.Simulation{Float64}(grid, boundary)
```
### Running the Simulation
```julia
# Set initial concentrations
TUG.setConcentrations!(grid, [1.0, 1.0, 20.0, 1.0, 1.0])
# Run the simulation
TUG.run(simulation)
# Retrieve the concentrations
concentrations = TUG.getConcentrations(grid)
```
## More Information
For a detailed reference of all functionalities and more comprehensive examples, please refer to the documentation in this repository.