Merge branch 'no-python-namespace-clutter' into MiscImprovements
This commit is contained in:
commit
eb66db9c36
|
@ -36,7 +36,7 @@ sc = np.pi**(1./6.)/6.**(1./6.)
|
|||
beta = np.pi**(5./6.)/6.**(1./6.)/2.
|
||||
R1 = (3.*np.pi/4.)**(1./3.)
|
||||
|
||||
def CubeToBall(cube):
|
||||
def cube_to_ball(cube):
|
||||
"""
|
||||
Map a point in a uniform refinable cubical grid to a point on a uniform refinable grid on a ball.
|
||||
|
||||
|
@ -59,7 +59,7 @@ def CubeToBall(cube):
|
|||
ball = np.zeros(3)
|
||||
else:
|
||||
# get pyramide and scale by grid parameter ratio
|
||||
p = get_order(cube)
|
||||
p = _get_order(cube)
|
||||
XYZ = cube[p] * sc
|
||||
|
||||
# intercept all the points along the z-axis
|
||||
|
@ -87,7 +87,7 @@ def CubeToBall(cube):
|
|||
return ball
|
||||
|
||||
|
||||
def BallToCube(ball):
|
||||
def ball_to_cube(ball):
|
||||
"""
|
||||
Map a point on a uniform refinable grid on a ball to a point in a uniform refinable cubical grid.
|
||||
|
||||
|
@ -109,7 +109,7 @@ def BallToCube(ball):
|
|||
if np.allclose(ball,0.0,rtol=0.0,atol=1.0e-300):
|
||||
cube = np.zeros(3)
|
||||
else:
|
||||
p = get_order(ball)
|
||||
p = _get_order(ball)
|
||||
xyz3 = ball[p]
|
||||
|
||||
# inverse M_3
|
||||
|
@ -137,7 +137,7 @@ def BallToCube(ball):
|
|||
return cube
|
||||
|
||||
|
||||
def get_order(xyz):
|
||||
def _get_order(xyz):
|
||||
"""
|
||||
Get order of the coordinates.
|
||||
|
|
@ -7,19 +7,19 @@ with open(_os.path.join(_os.path.dirname(__file__),'VERSION')) as _f:
|
|||
version = _re.sub(r'^v','',_f.readline().strip())
|
||||
|
||||
# classes
|
||||
from .environment import Environment # noqa
|
||||
from .table import Table # noqa
|
||||
from .ktv import VTK # noqa
|
||||
from .colormaps import Colormap, Color # noqa
|
||||
from .rotation import Rotation # noqa
|
||||
from .lattice import Symmetry, Lattice# noqa
|
||||
from .orientation import Orientation # noqa
|
||||
from .result import Result # noqa
|
||||
from .geom import Geom # noqa
|
||||
from .solver import Solver # noqa
|
||||
from ._environment import Environment # noqa
|
||||
from ._table import Table # noqa
|
||||
from ._vtk import VTK # noqa
|
||||
from ._colormaps import Colormap, Color # noqa
|
||||
from ._rotation import Rotation # noqa
|
||||
from ._lattice import Symmetry, Lattice# noqa
|
||||
from ._orientation import Orientation # noqa
|
||||
from ._result import Result # noqa
|
||||
from ._geom import Geom # noqa
|
||||
from ._solver import Solver # noqa
|
||||
|
||||
# deprecated
|
||||
from .asciitable import ASCIItable # noqa
|
||||
from ._asciitable import ASCIItable # noqa
|
||||
from ._config import Material # noqa
|
||||
from ._test import Test # noqa
|
||||
from .util import extendableOption # noqa
|
||||
from .config import Material # noqa
|
||||
from .test import Test # noqa
|
||||
|
|
|
@ -1,10 +1,8 @@
|
|||
import numpy as np
|
||||
|
||||
from .rotation import Rotation
|
||||
from . import Rotation
|
||||
|
||||
P = -1
|
||||
|
||||
# ******************************************************************************************
|
||||
class Symmetry:
|
||||
"""
|
||||
Symmetry operations for lattice systems.
|
|
@ -1,7 +1,7 @@
|
|||
import numpy as np
|
||||
|
||||
from .lattice import Lattice
|
||||
from .rotation import Rotation
|
||||
from . import Lattice
|
||||
from . import Rotation
|
||||
|
||||
class Orientation:
|
||||
"""
|
|
@ -1,6 +1,6 @@
|
|||
import numpy as np
|
||||
|
||||
from . import Lambert
|
||||
from ._Lambert import ball_to_cube, cube_to_ball
|
||||
|
||||
P = -1
|
||||
|
||||
|
@ -802,7 +802,7 @@ class Rotation:
|
|||
@staticmethod
|
||||
def ho2cu(ho):
|
||||
"""Homochoric vector to cubochoric vector."""
|
||||
return Lambert.BallToCube(ho)
|
||||
return ball_to_cube(ho)
|
||||
|
||||
|
||||
#---------- Cubochoric ----------
|
||||
|
@ -834,4 +834,4 @@ class Rotation:
|
|||
@staticmethod
|
||||
def cu2ho(cu):
|
||||
"""Cubochoric vector to homochoric vector."""
|
||||
return Lambert.CubeToBall(cu)
|
||||
return cube_to_ball(cu)
|
|
@ -85,7 +85,7 @@ def left_stretch(T):
|
|||
Tensor of which the left stretch is computed.
|
||||
|
||||
"""
|
||||
return __polar_decomposition(T,'V')[0]
|
||||
return _polar_decomposition(T,'V')[0]
|
||||
|
||||
|
||||
def maximum_shear(T_sym):
|
||||
|
@ -113,7 +113,7 @@ def Mises_strain(epsilon):
|
|||
Symmetric strain tensor of which the von Mises equivalent is computed.
|
||||
|
||||
"""
|
||||
return __Mises(epsilon,2.0/3.0)
|
||||
return _Mises(epsilon,2.0/3.0)
|
||||
|
||||
|
||||
def Mises_stress(sigma):
|
||||
|
@ -126,7 +126,7 @@ def Mises_stress(sigma):
|
|||
Symmetric stress tensor of which the von Mises equivalent is computed.
|
||||
|
||||
"""
|
||||
return __Mises(sigma,3.0/2.0)
|
||||
return _Mises(sigma,3.0/2.0)
|
||||
|
||||
|
||||
def PK2(P,F):
|
||||
|
@ -158,7 +158,7 @@ def right_stretch(T):
|
|||
Tensor of which the right stretch is computed.
|
||||
|
||||
"""
|
||||
return __polar_decomposition(T,'U')[0]
|
||||
return _polar_decomposition(T,'U')[0]
|
||||
|
||||
|
||||
def rotational_part(T):
|
||||
|
@ -171,7 +171,7 @@ def rotational_part(T):
|
|||
Tensor of which the rotational part is computed.
|
||||
|
||||
"""
|
||||
return __polar_decomposition(T,'R')[0]
|
||||
return _polar_decomposition(T,'R')[0]
|
||||
|
||||
|
||||
def spherical_part(T,tensor=False):
|
||||
|
@ -262,7 +262,7 @@ def transpose(T):
|
|||
np.transpose(T,(0,2,1))
|
||||
|
||||
|
||||
def __polar_decomposition(T,requested):
|
||||
def _polar_decomposition(T,requested):
|
||||
"""
|
||||
Singular value decomposition.
|
||||
|
||||
|
@ -290,7 +290,7 @@ def __polar_decomposition(T,requested):
|
|||
return tuple(output)
|
||||
|
||||
|
||||
def __Mises(T_sym,s):
|
||||
def _Mises(T_sym,s):
|
||||
"""
|
||||
Base equation for Mises equivalent of a stres or strain tensor.
|
||||
|
||||
|
|
Loading…
Reference in New Issue