From bd288e00e1296e41b99bbcd21ce8690a7a6ebbdd Mon Sep 17 00:00:00 2001 From: nebmit <76664673+nebmit@users.noreply.github.com> Date: Wed, 10 Jan 2024 19:04:04 +0100 Subject: [PATCH] docs: add TUG Julia package README.md --- julia/TUG/README.md | 88 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 88 insertions(+) create mode 100644 julia/TUG/README.md diff --git a/julia/TUG/README.md b/julia/TUG/README.md new file mode 100644 index 0000000..3dea370 --- /dev/null +++ b/julia/TUG/README.md @@ -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.