elasticity

package
v0.0.0-...-6493f53 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 13, 2021 License: MPL-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CalculateStrainEnergy

func CalculateStrainEnergy(params StrainEnergyInput) float64

CalculateStrainEnergy calculates the strain energy according to the parameters given in he passed parameters

func DisplacementMatrixElement

func DisplacementMatrixElement(m, n int, freq []float64, matProp Rank4Tensor) float64

DisplacementMatrixElement returns the (m, n) element of the matrix needed to find the displacements

func Displacements

func Displacements(ftBodyForce [][]complex128, freq Frequency, matProp Rank4Tensor) [][]complex128

Displacements calculates the fourier transformed displacements from a given body force

func Ellipsoid

func Ellipsoid(N int, a float64, b float64, c float64) *sfft.CMat3

Ellipsoid returns a voxel representation of an ellipsoid with half-axes given by a, b and c. The overall domai size will be N x N x N

func EnergyDensity

func EnergyDensity(matProp Rank4Tensor, strain *mat.Dense) float64

EnergyDensity calculates the strain energy

func HomogeneousModulusEnergy

func HomogeneousModulusEnergy(indicator []complex128, domainSize []int, misfit *mat.Dense, matProp Rank4) float64

HomogeneousModulusEnergy returns the elastic energy from a

func PerturbedForce

func PerturbedForce(ft FourierTransform, misfit *mat.Dense, ftDisp [][]complex128, shape GridFunc, matProp Rank4Tensor) [][]complex128

PerturbedForce returns the effective force for the first order perturbation arising from difference in the material properties. The deviation in material properties at position i is given by shape(i)*matProp. The fourier transformed effective force arising from the perturbation is given by

-delta C_{ijkl}*i*k_j(FT(misfit_kl - zero_eps_kl)shape(i))

where FT denotes the fourier transform, misfit_kl denotes the kl component of the misfit strain, zero_eps_kl denotes the kl component of the zeroth order strain (e.g. strain from the case where the elastic properties are constant)

func RotationMatrix

func RotationMatrix(angle float64, axis int) *mat.Dense

RotationMatrix creates the rotation matrix corresponding to a rotation around the specified axis

func Shear

func Shear(bulkMod float64, poisson float64) float64

Shear modulus returns the shear modulus when the bulk modulus and poisson ratio is known

func Strain

func Strain(ftDisp [][]complex128, freq Frequency, m, n int) []complex128

Strain returns the fourier transformed strains calculated from the fourier transformed displacements

Types

type EffectiveForce

type EffectiveForce struct {
	EffStress *mat.Dense
}

EffectiveForce is a type that is used to calculate an effective body force from a region of misfit strains

func NewEffectiveForceFromMisfit

func NewEffectiveForceFromMisfit(matProp Rank4, misfit *mat.Dense) EffectiveForce

NewEffectiveForceFromMisfit returns the effective force based on the elastic properties and the misfit strains

func (*EffectiveForce) Get

func (e *EffectiveForce) Get(comp int, freq Frequency, indicator []complex128) []complex128

Get a component of the effective force specified by comp. freq is a function that can returns the frequency of node i. indicator is a fourier transformed indicator function of the domain where the misfit strain exists.

type FourierTransform

type FourierTransform interface {
	Freq(i int) []float64

	FFT(data []complex128) []complex128

	IFFT(data []complex128) []complex128
}

FourierTransform is a generic interface for a multidimensional FFT

type Frequency

type Frequency func(i int) []float64

Frequency is a function that can return the frequency corresponding to an index in a 1D array (See the SFFT package)

type GridFunc

type GridFunc func(i int) float64

GridFunc is a function type that returns value from a grid

type Rank4

type Rank4 struct {
	Data []float64
}

Rank4 is a type used to represent a 3x3x3x3 tensor

func CubicMaterial

func CubicMaterial(c11 float64, c12 float64, c44 float64) Rank4

CubicMaterial returns the elastic tensor for a cubic material, where c11, c12 and c44 are constants in the Voigt representation

func FromFlatVoigt

func FromFlatVoigt(voigt []float64) Rank4

FromFlatVoigt constructs the elasticity tensor from the voigt representation of it

func Isotropic

func Isotropic(bulkMod float64, poisson float64) Rank4

Isotropic returns an elastic tensor

func NewRank4

func NewRank4() Rank4

NewRank4 returns a new rank4 tensor

func (*Rank4) At

func (r *Rank4) At(i, j, k, l int) float64

At returns the element at position (i, j, k, l)

func (*Rank4) ContractLast

func (r *Rank4) ContractLast(tensor *mat.Dense) *mat.Dense

ContractLast contracts the two last indices with the passed matrix

func (*Rank4) Rotate

func (r *Rank4) Rotate(rot mat.Matrix)

Rotate rotates the tensor

func (*Rank4) Set

func (r *Rank4) Set(i, j, k, l int, v float64)

Set sets a new value at position (i, j, k, l)

type Rank4Tensor

type Rank4Tensor interface {
	At(i, j, k, l int) float64
}

Rank4Tensor is an interface of entities that implementes an getter with four indices

type StrainEnergyInput

type StrainEnergyInput struct {
	HalfA             float64
	HalfB             float64
	HalfC             float64
	Misfit            []float64
	MatPropMatrix     []float64
	MatPropInc        []float64
	DomainSize        int
	ApplyPerturbation bool
}

StrainEnergyInput is a struct that holds all parameters needed to calculate the strain energy

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL