specfab documentation

Spectral CPO model of polycrystalline materials that can:

  • Model lattice rotation, discontinuous DRX, and rotation/continuous DRX.
  • Calculate CPO-induced viscous anisotropies using Sachs/Taylor homogenizations.
  • Calculate elastic P- and S-wave velocities using Voigt/Reuss homogenizations.
  • Provide expressions for forward+inverse orthotropic and transversely isotropic rheologies.
  • Convert between structure tensors and spectral expansions coefficients.
  • Be integrated with finite-element codes such as Elmer and FEniCS.

By Nicholas M. Rathmann and David A. Lilien

Glacier ice demo

Install

Source code is available here.

Environment How to install
Python in Linux - PyPI package: pip3 install numpy --upgrade && pip3 install specfabpy
- Compile yourself: cd src && make python
Python in Windows/Mac You will have to compile specfab yourself.
Fortran Run cd src && make specfab.o
Elmer/Ice Interface Compile shared library by running cd src && make libspecfab.so

Libraries required: BLAS, LAPACK

Initialize

Initialize specfab by running

import numpy as np
from specfabpy import specfab as sf

lm, nlm_len = sf.init(10) # L=10 truncation is sufficient for many cases

nlm = np.zeros(nlm_len, dtype=np.complex64) # vector of harmonic expansion coefficients
nlm[0] = 1/np.sqrt(4*np.pi) # normalized isotropic distribution

where

Variable Interpretation
nlm_len Number of expansion coefficients for expansion series truncated at \(l=L\)
nlm Vector of complex-valued expansion coefficients (state vector)
lm Vector of degree and order integers (l,m) associated with each entry in nlm