```{tags}
category:benchmark
feature:2d
feature:cartesian
feature:community-benchmark
feature:analytical-solution
feature:nonlinear-solver
feature:two-phase-flow
feature:melt
feature:modular-equations
```

(sec:benchmarks:shear_bands)=`
# Magmatic shear bands
This directory contains magmatic shear bands examples for Newtonian rheology (as defined
in Spiegelman, 2003, Linear analysis of melt band formation by simple shear) and for
non-linear/power-law rheology (as defined in Katz et al., 2006: The dynamics of melt and
shear localization in partially molten aggregates).

## Instructions for the magmatic shear bands testcase for Newtonian rheology

The ASPECT input file for the test case is magmatic_shear_bands.prm.

The scripts 'run_angle_melt_bands.sh' and 'plot_growth_over_angle.py' can be used to
generate data for the growth rate of plane wave melt bands, compare them to the rates
predicted from linear stability analysis and plot them over the band angle.
'run_angle_melt_bands.sh' outputs the data to the file 'plane_wave_melt_bands_angle',
and 'plot_growth_over_angle.py' plots them and saves them as 'growth_rate_angle.pdf'.

The scripts 'run_plane_melt_bands.sh' and 'plot_convergence.py' can be used to
generate data for the growth rate error of plane wave melt bands (compared to the rates
predicted from linear stability analysis) and plot the error over the number of degrees
of freedom. 'run_plane_melt_bands.sh' outputs the data to the files
'plane_wave_melt_bands_8pi' and 'plane_wave_melt_bands_16pi', and 'plot_convergence.py'
plots them and saves the plot as 'growth_rate_error.pdf'.

## Instructions for the magmatic shear bands testcase for non-linear rheology

The ASPECT input file for the test case is shear_bands.prm.

The python script 'plot_band_angle.py' can be used to plot the porosity field, the
fourier transform of the porosity field, and the band angle distribution (of the last
time step) for a single model, using a csv file generated by the 'shear bands
statistics' postprocessor that can be specified as postprocessor in the ASPECT input
file.

The python scripts 'plot_hist_and_porosity.py' and 'plot_band_angle_dofs.py'
can be used to plot the porosity field of the last timestep of a shear
bands model together with the histograms showing the distribution of
band angles. In addition, 'plot_hist_and_porosity.py' will generate files
that can be used as input for plotting the dominant band angle with
'plot_band_angle_dofs.py', which plots the mode of a lognormal distribution
fitted to the distribution of band angles. Both scripts will use the data
files present in the folder as input if run without arguments, and as
default expect that there are data files present for 6...9 global refinements
(shear_bands_7.csv ... shear_bands_10.csv; shear_bands_7_adaptive.csv ...
shear_bands_10_adaptive.csv).
