If you would like to modify HeatTrans package yourself or contribute back to the original repository, then the following instructions can help you. First you need to install Git and clone the project from its GitHub homepage to your local computer.
Essential:
- Mathematica version 11.3 or later
- AceFEM/AceGen packages version 6.912 or later
Recommended:
- Wolfram Workbench for building documentation
- WolframScript for building the
.pacletfile from command line. On most systems it already comes bundled with Mathematica installation.
It is considered good practice that every (public) function in this package includes its own set of unit tests.
A bunch of them is collected in Tests/Tests.wl file, using the Mathematica testing
framework.
It is recommended that you run them periodically during development and especially before every commit.
This can be done by calling script file Tests/RunTests.wls in command line
(first change directory to project root directory) or by evaluating whole notebook Tests/RunTests.nb.
Unit test can be run automatically before every commit via Git client-side
hooks.
File pre-commit should contain call to Tests/RunTests.wls script,
which exits with value 0 if all tests pass and aborts the commit otherwise.
Minimal example of pre-commit file content is:
#!/bin/sh
./Tests/RunTests.wls
There a 3 phases in building the package from source code. First you need to generate finite element subroutines
which are later used with AceFEM framework. Documentation notebooks have to be processed for proper integration
into Mathematica documentation center and finally the package is assembled in .paclet file.
Finite element subroutines for assembly of residual vector and tangent matrix are
written using AceGen package functions. AceGen code generates .C files,
which are then compiled to libraries for each operating system.
This procedure is happens by evaluating the whole notebook Elements/GenerateElements.nb.
First, import HeatTrans in Wolfram Workbench:
- Select "File" -> "Open project from file system" ...
- Add path to project root directory and click "Finish"
Importing of the HeatTrans source needs to be done only once. Next, build the documentation:
- Select "Window" -> "Show view" -> "Application Tools"
- In "Application Tools" panel choose the name of the project and click "Build" documentation
This will create a folder named build, which will contain folder HeatTrans that contains the build documentation of package.
Open terminal window (command line) in HeatTrans root directory and run file Build.wls.
This will leave you with a HeatTrans-X.Y.Z.paclet file in the build folder.