# Geometry of Needle-Like Microstructures in Shape-Memory Alloys

This repository contains the code to

*Conti, S., Lenz, M., Rumpf, M., Verhülsdonk, V., Zwicknagl, B.,* Geometry of Needle-Like Microstructures in Shape-Memory Alloys. *Shap. Mem. Superelasticity* (2023). https://doi.org/10.1007/s40830-023-00442-0

The code is licensed under the MIT license, see license.txt

If you use this code for your own research, please cite the publication listed above.

## Setup

Within the repository we provide a environment file `environment.yml` that can be used to install the requirements with Anaconda via

`conda env create -f environment.yml` .

to set up the anaconda environment containing fenics and dolfin adjoint. Then activate the environment with

`conda activate needle_geometry` .


## Running the experiments

To start the program just use

`python main.py --experiment exp`

where you can choose `exp` for the experiment among

* single: computes a single shape optimization for a given set of parameters,
* materials: Shape optimization for different material choices: CuAlNi, NiAl, YBaCuO. (See Fig. 4),
* delta: Varies the $\delta$ parameter (See Fig. 5),
* anisotropy: Varies the anisotropy parameter $A$ (See Fig. 6),
* poisson_ratio: Varies the Poisson ratio $\nu$ (See Fig. 6),
* theta: Varies the volume fraction $\theta$ (See Fig. 7),

where the above references correspond to the associated figures in our paper.

You can use the optional flag `--no_output` to prevent the generation of any output.

The current version of the codes uses a highly resolved grid which is used in the paper.
One can obtain faster results with a smaller choice for the `resolution` parameter.
