Mathematica auxiliary functions
The solution of the FEM problem is based on the use of the AceFEM/AceGen tools, however it requires several auxiliary functions to be defined in Mathematica. These functions are used to define the material properties, the boundary conditions, the post-processing routines, etc. The following sections describe the main auxiliary functions.
All the functions are defined in the axuFncs package, which is loaded in the main Mathematica script:
Get["axuFncs`"]
The package is structured into four main subpackages:
myFileName.m. This subpackage contains the definition of the file names, which is used to save the results. It automatically retrives the correct paths based on the notebook directory and the user directory.
myLoading.m. This subpackage allows to load the mesh and the material properties as well as set up the FEm problem in term of material properties and boundary conditions.
myPostAuxialiars.m. This subpackage contains the post-processing routines, which are used to compute several quantities between each solving step as well as drive the convergence procedure.
myExpRoutines.m. This subpackage contains the exporting routines, which are used to save the results in the correct format.
Note
Given the large number of elements and the complexity of the problem, results are often very large and require a lot of memory to be stored. For this reason, the results are saved in a compressed format and post-processed using the Python myPatientV2.py package.
Warning
You need to add the path to the axuFncs package in the Mathematica $Path variable.
This can be easly done using the relative path:
basePath = NotebookDirectory[];
currPathID =
Flatten@Position[
StringContainsQ[
Flatten@StringSplit[StringSplit[basePath, "/"], "\\"],
StringTake[StringCases[basePath, "T" ~~ __ ~~ "_"], 4]], True];
path = Flatten[StringSplit[StringSplit[basePath, "/"], "\\"]][[
1 ;; currPathID[[1]] - 1]]; If[
Not@StringContainsQ[$OperatingSystem, "Win"],
PrependTo[path, "/"];
];
AppendTo[path, "T00_Common"]; AppendTo[$Path, FileNameJoin[path]];