2024-03-12 15:03:50 +01:00
..
2024-03-12 15:03:50 +01:00
2024-03-12 15:03:50 +01:00

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.

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:
    (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> using TUG
    

Building the Documentation

To build the documentation for TUG:

  1. Navigate to the docs Directory:
    cd path/to/tug/julia/TUG/docs
    
  2. Build the Documentation:
    julia make.jl
    

Running Tests

To run the tests for TUG, follow these steps:

  1. Navigate to the TUG Package Directory:
    cd path/to/tug/julia/TUG
    
  2. Enter Pkg mode and run the tests:
    (v1.x) pkg> test TUG
    

Getting Started

To get started with TUG:

Creating a Simulation

# 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

# 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.