The Contimech Library
- simcoon.simmit.dev(input: Annotated[numpy.typing.ArrayLike, numpy.float64], copy: bool = True) numpy.typing.NDArray[numpy.float64]
Returns the deviatoric part of a 3x3 matrix.
- Parameters:
m (pybind11::array_t<double>) – Input 3x3 matrix.
- Returns:
Deviatoric part of the input matrix.
- Return type:
pybind11::array_t<double>
Examples
import numpy as np import simcoon as sim # Example for dev m = np.array([[1, 0, 0], [0, 1, 0], [0, 0, 1]]) dev_m = sim.dev(m) print(dev_m)
- simcoon.simmit.sph(input: Annotated[numpy.typing.ArrayLike, numpy.float64], copy: bool = True) numpy.typing.NDArray[numpy.float64]
Returns the spherical part of a 3x3 matrix.
- Parameters:
m (pybind11::array_t<double>) – Input 3x3 matrix.
- Returns:
Spherical part of the input matrix.
- Return type:
pybind11::array_t<double>
Examples
import numpy as np import simcoon as sim # Example for sph m = np.array([[1, 0, 0], [0, 1, 0], [0, 0, 1]]) sph_m = sim.sph(m) print(sph_m)
- simcoon.simmit.tr(input: Annotated[numpy.typing.ArrayLike, numpy.float64]) float
Returns the trace of a tensor expressed in Voigt notation.
- Parameters:
v (pybind11::array_t<double>) – Input tensor in Voigt notation.
- Returns:
Trace of the input tensor.
- Return type:
pybind11::array_t<double>
Examples
import numpy as np import simcoon as sim # Example for tr v = np.array([1, 1, 1, 0, 0, 0]) trace = sim.tr(v) print(trace)
- simcoon.simmit.Mises_stress(input: Annotated[numpy.typing.ArrayLike, numpy.float64]) float
Provides the Von Mises stress of a second-order stress tensor written as a vector in Voigt notation.
- Parameters:
v (pybind11::array_t<double>) – Input stress tensor in Voigt notation.
- Returns:
Von Mises stress of the input tensor.
- Return type:
pybind11::array_t<double>
Examples
import numpy as np import simcoon as sim # Example for Mises_stress v = np.array([1, 1, 1, 0, 0, 0]) stress = sim.Mises_stress(v) print(stress)
- simcoon.simmit.eta_stress(input: Annotated[numpy.typing.ArrayLike, numpy.float64], copy: bool = True) numpy.typing.NDArray[numpy.float64]
Provides the stress flow of a second-order stress tensor written as a vector in Voigt notation.
- Parameters:
v (pybind11::array_t<double>) – Input stress tensor in Voigt notation.
- Returns:
Stress flow of the input tensor.
- Return type:
pybind11::array_t<double>
Examples
import numpy as np import simcoon as sim # Example for eta_stress v = np.array([1, 1, 1, 0, 0, 0]) flow = sim.eta_stress(v) print(flow)
- simcoon.simmit.Mises_strain(input: Annotated[numpy.typing.ArrayLike, numpy.float64]) float
Provides the Von Mises strain of a second-order strain tensor.
- Parameters:
v (pybind11::array_t<double>) – Input strain tensor in Voigt notation.
- Returns:
Von Mises strain of the input tensor.
- Return type:
pybind11::array_t<double>
Examples
import numpy as np import simcoon as sim # Example for Mises_strain v = np.array([1, 1, 1, 0, 0, 0]) strain = sim.Mises_strain(v) print(strain)
- simcoon.simmit.eta_strain(input: Annotated[numpy.typing.ArrayLike, numpy.float64], copy: bool = True) numpy.typing.NDArray[numpy.float64]
Provides the strain flow of a second-order strain tensor written as a vector in Voigt notation.
- Parameters:
v (pybind11::array_t<double>) – Input strain tensor in Voigt notation.
- Returns:
Strain flow of the input tensor.
- Return type:
pybind11::array_t<double>
Examples
import numpy as np import simcoon as sim # Example for eta_strain v = np.array([1, 1, 1, 0, 0, 0]) flow = sim.eta_strain(v) print(flow)
- simcoon.simmit.J2_stress(input: Annotated[numpy.typing.ArrayLike, numpy.float64]) float
Provides the second invariant of the deviatoric part of a second-order stress tensor, written as a vector in Voigt notation.
- Parameters:
v (pybind11::array_t<double>) – Input stress tensor in Voigt notation.
- Returns:
Second invariant of the deviatoric part of the input tensor.
- Return type:
pybind11::array_t<double>
Examples
import numpy as np import simcoon as sim # Example for J2_stress v = np.array([1, 1, 1, 0, 0, 0]) invariant = sim.J2_stress(v) print(invariant)
- simcoon.simmit.J2_strain(input: Annotated[numpy.typing.ArrayLike, numpy.float64]) float
Provides the second invariant of the deviatoric part of a second-order strain tensor, written as a vector in Voigt notation.
- Parameters:
v (pybind11::array_t<double>) – Input strain tensor in Voigt notation.
- Returns:
Second invariant of the deviatoric part of the input tensor.
- Return type:
pybind11::array_t<double>
Examples
import numpy as np import simcoon as sim # Example for J2_strain v = np.array([1, 1, 1, 0, 0, 0]) invariant = sim.J2_strain(v) print(invariant)
- simcoon.simmit.J3_stress(input: Annotated[numpy.typing.ArrayLike, numpy.float64]) float
Provides the third invariant of the deviatoric part of a second-order stress tensor, written as a vector in Voigt notation.
- Parameters:
v (pybind11::array_t<double>) – Input stress tensor in Voigt notation.
- Returns:
Third invariant of the deviatoric part of the input tensor.
- Return type:
pybind11::array_t<double>
Examples
import numpy as np import simcoon as sim # Example for J3_stress v = np.array([1, 1, 1, 0, 0, 0]) invariant = sim.J3_stress(v) print(invariant)
- simcoon.simmit.J3_strain(input: Annotated[numpy.typing.ArrayLike, numpy.float64]) float
Provides the third invariant of the deviatoric part of a second-order strain tensor, written as a vector in Voigt notation.
- Parameters:
v (pybind11::array_t<double>) – Input strain tensor in Voigt notation.
- Returns:
Third invariant of the deviatoric part of the input tensor.
- Return type:
pybind11::array_t<double>
Examples
import numpy as np import simcoon as sim # Example for J3_strain v = np.array([1, 1, 1, 0, 0, 0]) invariant = sim.J3_strain(v) print(invariant)
- simcoon.simmit.Macaulay_p(value: SupportsFloat) float
Provides the results of the MacCaulay brackets operator <>+.
- Parameters:
d (pybind11::array_t<double>) – Input tensor.
- Returns:
Result of the MacCaulay brackets operator <>+.
- Return type:
pybind11::array_t<double>
Examples
import numpy as np import simcoon as sim # Example for Macaulay_p d = np.array([1, -1, 0]) result = sim.Macaulay_p(d) print(result)
- simcoon.simmit.Macaulay_n(value: SupportsFloat) float
Provides the results of the MacCaulay brackets operator <>-.
- Parameters:
d (pybind11::array_t<double>) – Input tensor.
- Returns:
Result of the MacCaulay brackets operator <>-.
- Return type:
pybind11::array_t<double>
Examples
import numpy as np import simcoon as sim # Example for Macaulay_n d = np.array([1, -1, 0]) result = sim.Macaulay_n(d) print(result)
- simcoon.simmit.sign(value: SupportsFloat) float
Provides the results of the sign operator.
- Parameters:
d (pybind11::array_t<double>) – Input tensor.
- Returns:
Result of the sign operator.
- Return type:
pybind11::array_t<double>
Examples
import numpy as np import simcoon as sim # Example for sign d = np.array([1, -1, 0]) result = sim.sign(d) print(result)
- simcoon.simmit.normal_ellipsoid(u: SupportsFloat, v: SupportsFloat, a1: SupportsFloat, a2: SupportsFloat, a3: SupportsFloat, copy: bool = True) numpy.typing.NDArray[numpy.float64]
Provides the normalized vector normal to an ellipsoid with semi-principal axes of length a1, a2, a3.
- Parameters:
u (pybind11::array_t<double>) – Input vector u.
v (pybind11::array_t<double>) – Input vector v.
a1 (pybind11::array_t<double>) – Length of semi-principal axis a1.
a2 (pybind11::array_t<double>) – Length of semi-principal axis a2.
a3 (pybind11::array_t<double>) – Length of semi-principal axis a3.
- Returns:
Normalized vector normal to the ellipsoid.
- Return type:
pybind11::array_t<double>
Examples
import numpy as np import simcoon as sim # Example for normal_ellipsoid u = np.array([1, 0, 0]) v = np.array([0, 1, 0]) a1 = np.array([1]) a2 = np.array([1]) a3 = np.array([1]) normal = sim.normal_ellipsoid(u, v, a1, a2, a3) print(normal)
- simcoon.simmit.curvature_ellipsoid(u: SupportsFloat, v: SupportsFloat, a1: SupportsFloat, a2: SupportsFloat, a3: SupportsFloat) float
Provides the curvature of an ellipsoid with semi-principal axes of length a1, a2, a3 at the angle u,v.
- Parameters:
u (pybind11::array_t<double>) – Input vector u.
v (pybind11::array_t<double>) – Input vector v.
a1 (pybind11::array_t<double>) – Length of semi-principal axis a1.
a2 (pybind11::array_t<double>) – Length of semi-principal axis a2.
a3 (pybind11::array_t<double>) – Length of semi-principal axis a3.
- Returns:
Curvature of the ellipsoid.
- Return type:
pybind11::array_t<double>
Examples
import numpy as np import simcoon as sim # Example for curvature_ellipsoid u = np.array([1, 0, 0]) v = np.array([0, 1, 0]) a1 = np.array([1]) a2 = np.array([1]) a3 = np.array([1]) curvature = sim.curvature_ellipsoid(u, v, a1, a2, a3) print(curvature)
- simcoon.simmit.sigma_int(input: Annotated[numpy.typing.ArrayLike, numpy.float64], u: SupportsFloat, v: SupportsFloat, a1: SupportsFloat, a2: SupportsFloat, a3: SupportsFloat, copy: bool = True) numpy.typing.NDArray[numpy.float64]
Provides the normal and tangent components of the traction vector in the normal direction n to an ellipsoid with axes a1, a2, a3 from an input inside stress.
- Parameters:
sigma_in (pybind11::array_t<double>) – Input stress tensor.
u (pybind11::array_t<double>) – Input vector u.
v (pybind11::array_t<double>) – Input vector v.
a1 (pybind11::array_t<double>) – Length of semi-principal axis a1.
a2 (pybind11::array_t<double>) – Length of semi-principal axis a2.
a3 (pybind11::array_t<double>) – Length of semi-principal axis a3.
- Returns:
Normal and tangent components of the traction vector.
- Return type:
pybind11::array_t<double>
Examples
import numpy as np import simcoon as sim # Example for sigma_int sigma_in = np.array([1, 1, 1, 0, 0, 0]) u = np.array([1, 0, 0]) v = np.array([0, 1, 0]) a1 = np.array([1]) a2 = np.array([1]) a3 = np.array([1]) result = sim.sigma_int(sigma_in, u, v, a1, a2, a3) print(result)
- simcoon.simmit.p_ikjl(normal: Annotated[numpy.typing.ArrayLike, numpy.float64], copy: bool = True) numpy.typing.NDArray[numpy.float64]
Computes the Hill interfacial operator according to a normal a.
- Parameters:
a (pybind11::array_t<double>) – Input normal vector.
- Returns:
Hill interfacial operator.
- Return type:
pybind11::array_t<double>
Examples
import numpy as np import simcoon as sim # Example for p_ikjl a = np.array([1, 0, 0]) result = sim.p_ikjl(a) print(result)
- simcoon.simmit.auto_sym_dyadic(input: Annotated[numpy.typing.ArrayLike, numpy.float64], copy: bool = True) numpy.typing.NDArray[numpy.float64]
Provides the dyadic product of a symmetric tensor with itself.
- Parameters:
a (pybind11::array_t<double>) – Input symmetric tensor.
- Returns:
Dyadic product of the input tensor with itself.
- Return type:
pybind11::array_t<double>
Examples
import numpy as np import simcoon as sim # Example for auto_sym_dyadic a = np.random.rand(3, 3) a = (a + a.T) / 2 # Make a symmetric result = sim.auto_sym_dyadic(a) print(result)
- simcoon.simmit.sym_dyadic(a: Annotated[numpy.typing.ArrayLike, numpy.float64], b: Annotated[numpy.typing.ArrayLike, numpy.float64], copy: bool = True) numpy.typing.NDArray[numpy.float64]
Provides the dyadic product of two symmetric tensors.
- Parameters:
a (pybind11::array_t<double>) – Input symmetric tensor a.
b (pybind11::array_t<double>) – Input symmetric tensor b.
- Returns:
Dyadic product of the input tensors.
- Return type:
pybind11::array_t<double>
Examples
import numpy as np import simcoon as sim # Example for sym_dyadic a = np.random.rand(3, 3) a = (a + a.T) / 2 # Make a symmetric b = np.random.rand(3, 3) b = (b + b.T) / 2 # Make a symmetric result = sim.sym_dyadic(a, b) print(result)
- simcoon.simmit.auto_dyadic(input: Annotated[numpy.typing.ArrayLike, numpy.float64], copy: bool = True) numpy.typing.NDArray[numpy.float64]
Provides the dyadic product of a tensor with itself.
- Parameters:
a (pybind11::array_t<double>) – Input tensor.
- Returns:
Dyadic product of the input tensor with itself.
- Return type:
pybind11::array_t<double>
Examples
import numpy as np import simcoon as sim # Example for auto_dyadic a = np.random.rand(3, 3) a = (a + a.T) / 2 # Make a symmetric result = sim.auto_dyadic(a) print(result)
- simcoon.simmit.dyadic_4vectors_sym(n_a: Annotated[numpy.typing.ArrayLike, numpy.float64], n_b: Annotated[numpy.typing.ArrayLike, numpy.float64], conv: str, copy: bool = True) numpy.typing.NDArray[numpy.float64]
Provides the dyadic product of four vectors to provide a symmetric 4th order tensor.
- Parameters:
a (pybind11::array_t<double>) – Input vector n_a.
b (pybind11::array_t<double>) – Input vector n_b.
conv (std::string) – Convention for the dyadic product.
- Returns:
Symmetric 4th order tensor.
- Return type:
pybind11::array_t<double>
Examples
import numpy as np import simcoon as sim # Example for dyadic_4vectors_sym a = np.array([1, 0, 0]) b = np.array([0, 1, 0]) conv = "aabb" # or "abab" result = sim.dyadic_4vectors_sym(a, b, conv) print(result)
- simcoon.simmit.auto_sym_dyadic_operator(input: Annotated[numpy.typing.ArrayLike, numpy.float64], copy: bool = True) numpy.typing.NDArray[numpy.float64]
Provides the symmetric 4th-order dyadic product of a symmetric tensor with itself.
- Parameters:
a (pybind11::array_t<double>) – Input symmetric tensor.
- Returns:
Symmetric 4th-order dyadic product of the input tensor with itself.
- Return type:
pybind11::array_t<double>
Examples
import numpy as np import simcoon as sim # Example for auto_sym_dyadic_operator a = np.random.rand(3, 3) a = (a + a.T) / 2 # Make a symmetric result = sim.auto_sym_dyadic_operator(a) print(result)
- simcoon.simmit.sym_dyadic_operator(a: Annotated[numpy.typing.ArrayLike, numpy.float64], b: Annotated[numpy.typing.ArrayLike, numpy.float64], copy: bool = True) numpy.typing.NDArray[numpy.float64]
Provides the symmetric 4th-order dyadic product of two symmetric tensors.
- Parameters:
a (pybind11::array_t<double>) – Input symmetric tensor a.
b (pybind11::array_t<double>) – Input symmetric tensor b.
- Returns:
Symmetric 4th-order dyadic product of the input tensors.
- Return type:
pybind11::array_t<double>
Examples
import numpy as np import simcoon as sim # Example for sym_dyadic_operator a = np.random.rand(3, 3) a = (a + a.T) / 2 # Make a symmetric b = np.random.rand(3, 3) b = (b + b.T) / 2 # Make b symmetric result = sim.sym_dyadic_operator(a, b) print(result)