-
Notifications
You must be signed in to change notification settings - Fork 1
Setup
To make a clone of the repository k223d can be done using the following commands:
git clone https://github.com/s-murfy/k223d.git
k223d is written in fortran and requires a fortran compiler in order to build an executable. A makefile is provided which is currently set up to compile for gfortran. However if you have an Intel Fortran compiler, open the make file and uncomment the two relavent ifort FC and FCFLAGS lines and comment the gfortran ones. To compile the k223d type in the terminal:
cd k223d/codes
make
The k223d should now compile. To date this has been tested using gfortran and Intel Fortran, the makefile can be easily manipulated to include other compilers. In the case of the docker example below, gfortran libraries are preloaded into the docker environment.
This involves two steps
- Compile k223d (outlined above)
- Start a jupyter notebook
After compiling k223d compiled the Jupyter notebooks can be opened. These are found in notebook folder. There are two examples provided: in the folder planar_eg the file planar_mesh.ipynb is a workflow on how to produce a planar mesh, run k223d and view the results. In the folder EFSM_eg the file read_EFSM20.ipynb provides an example on how to read a mesh from the EFSM database, remesh it, run k223d, view the results and generate an file that can be viewed in QGIS.
There are two approaches that can be used to run k223d through docker. Both methods will require the installation of docker The first and easier is to pull a container from Docker Hub at the following repository. The second is to build the docker image on your computer. To do this follow the instructions below.
This can be done two ways, the first through a terminal in Docker or in a terminal of the operating system. In both cases the Docker software needs to be running.
-
navigate to the k223d folder with the dockerfile.
-
Type the following into the prompt:
DOCKER_BUILDKIT=1 docker build -t k223d-image .if this gives an error, it is possible the BUILDKIT is already setup in which case the following will work:
docker build -t k223d-image .Another source of error can be caused by having a VPN active when attempting to build the image.
-
Compiling of the image can take a few minutes
With the container built we can now start the image.
To do so, either press play in docker, after which a window will appear for optional settings, click down and add 8888 for the host port option.
- In terminal the following command achieves the same results :
docker run -p 8888:8888 -v $(pwd):/app k223d-image
In both cases lines of text are streamed to the screen either in docker or in the terminal. In this text look for the two lines with http://
Copy one of them into the internet browser to start the jupyter notebook. Generally http://127.0.0.0.1 works best.
If you want to copy a file created by k223d or by one of the Notebooks, right click on the file in the notebook and select download and a copy of the file will be put in your Downloads folder.
To import files inside the container, start the container and use the docker cp command in a terminal to copy the file in. Below is an example of how to copy the file test.txt into the /notebook/EFSM_eg folder within in container:
docker cp test.txt ContainerID:app/notebook/EFSM_eg