ffeatools.modules.FFEA_rod.py_rod_math Class Reference
Inheritance diagram for ffeatools.modules.FFEA_rod.py_rod_math:
ffeatools.modules.FFEA_rod.fast_rod_math

Public Member Functions

def get_twist_angle (self, m_i, m_j)
 
def get_signed_angle (self, m1, m2, l)
 
def parallel_transport (self, m_i, a, b)
 
def get_length (self, vec)
 
def normalize (self, vec)
 
def get_cos_theta (self, a, b)
 
def get_dist (self, a, b)
 
def kb_i (self, pi, pim1)
 
def omega (self, pi, pim1, m2j, m1j)
 
def get_analytical_deflection (self, P, L, EI)
 
def get_analytical_persistence_length (self, EI, T)
 
def approximately_equal (self, a, b, factor_of_error)
 
def rodrigues (self, v, k, theta)
 
def get_stretch_energy (self, k, p_i, p_i_equil)
 
def get_twist_energy (self, mim1, mim1_equil, mi, mi_equil, pim1, pim1_equil, pi, pi_equil, beta)
 
def get_bend_energy (self, p_im1, p_i, p_im1_equil, p_i_equil, n_im1, m_im1, n_im1_equil, m_im1_equil, n_i, m_i, n_i_equil, m_i_equil, B_i_equil, B_im1_equil)
 
def perpendicularize (self, m_i, p_i)
 
def get_euler_angles (self, rm)
 

Detailed Description

This object contains pure functions relating to mathematical formulas for
the rods, simular to rod_math.cpp.

Member Function Documentation

◆ approximately_equal()

def ffeatools.modules.FFEA_rod.py_rod_math.approximately_equal (   self,
  a,
  b,
  factor_of_error 
)
Given two values and a margin of error, check if the two values are
within that error of one another.
Params: a, b, margin
Returns: boolean, true if they are within the margin, false otherwise.

◆ get_analytical_deflection()

def ffeatools.modules.FFEA_rod.py_rod_math.get_analytical_deflection (   self,
  P,
  L,
  EI 
)
Get the excepcted deflection W of the rod based on P, the force acting
upon the end node, L, the length, and EI (B), the bending modulus.
W = (P*L^)3/(3*EI)

◆ get_analytical_persistence_length()

def ffeatools.modules.FFEA_rod.py_rod_math.get_analytical_persistence_length (   self,
  EI,
  T 
)
Get the expected value of the persistence length based on the temperature
T and the bending modulus EI (B).
P = EI/(k_B*T)

◆ get_bend_energy()

def ffeatools.modules.FFEA_rod.py_rod_math.get_bend_energy (   self,
  p_im1,
  p_i,
  p_im1_equil,
  p_i_equil,
  n_im1,
  m_im1,
  n_im1_equil,
  m_im1_equil,
  n_i,
  m_i,
  n_i_equil,
  m_i_equil,
  B_i_equil,
  B_im1_equil 
)

◆ get_cos_theta()

def ffeatools.modules.FFEA_rod.py_rod_math.get_cos_theta (   self,
  a,
  b 
)
For two vectors, a and b, get the cosine of the angle between them.
Returns a float.

◆ get_dist()

def ffeatools.modules.FFEA_rod.py_rod_math.get_dist (   self,
  a,
  b 
)
Get the length of the vector between two vectors a and b. Returns a
float.

◆ get_euler_angles()

def ffeatools.modules.FFEA_rod.py_rod_math.get_euler_angles (   self,
  rm 
)

◆ get_length()

def ffeatools.modules.FFEA_rod.py_rod_math.get_length (   self,
  vec 
)
Given a vector, vec, return the length of the vector, a float.

Referenced by ffeatools.modules.FFEA_rod.py_rod_math.get_dist(), and ffeatools.modules.FFEA_rod.py_rod_math.get_stretch_energy().

◆ get_signed_angle()

def ffeatools.modules.FFEA_rod.py_rod_math.get_signed_angle (   self,
  m1,
  m2,
  l 
)
Same as the above, but the angle is signed (left hand rotation).
Params: m1, m2 - the two material axis vectors being measured.
l: the normalized element vector.
returns: the angle between them, in radians.

◆ get_stretch_energy()

def ffeatools.modules.FFEA_rod.py_rod_math.get_stretch_energy (   self,
  k,
  p_i,
  p_i_equil 
)
Get the stretch energy for a particular element.
Params:
    k, the stretching constant (not the spring constant!)
    p_i, a 1-d array of 3 points, the p_ith element
    p_i_equil, the equilibrium p_ith element
Returns:
    the stretch energy.

◆ get_twist_angle()

def ffeatools.modules.FFEA_rod.py_rod_math.get_twist_angle (   self,
  m_i,
  m_j 
)
Get the angle between two vectors, assumed to have been parallel
tranported into the same basis.
Params: m_i, m_j, two vectors
Returns: the angle between them.

◆ get_twist_energy()

def ffeatools.modules.FFEA_rod.py_rod_math.get_twist_energy (   self,
  mim1,
  mim1_equil,
  mi,
  mi_equil,
  pim1,
  pim1_equil,
  pi,
  pi_equil,
  beta 
)
Get the energy associated with a particular twist. Note: this uses the
new version of the twist energy calculation that allows for intrinsically
twisted equilibrium configurations.
Params:
    mim1: 1-d numpy array with xyz co-ordinates for mim1, the i-1th material axis.
    mim1_equil: the equilibrium configuration of the i-1th material axis.
    mi: the ith material axis
    mi_equil: the equilibrium ith material axis
    pim1: 1-d numpy array with xyz co-ordinates for pim1, the i-1th element.
    pim1_equil: the equilibrium configuration of the i-1th element.
    pi: the ith element
    pi_equil: the equilibrium ith element
    beta: a float, the twisting constant
Returns:
    the twist energy

◆ kb_i()

def ffeatools.modules.FFEA_rod.py_rod_math.kb_i (   self,
  pi,
  pim1 
)
For p_i and p_im1, return the value of the vector kb_i. For more
information on this, please check the bend energy functions in rod_math.

Referenced by ffeatools.modules.FFEA_rod.py_rod_math.omega().

◆ normalize()

def ffeatools.modules.FFEA_rod.py_rod_math.normalize (   self,
  vec 
)
Given a vector, vec, return the normalized version of that vector, a
vector (a 1-D numpy array containing 3 values.)

Referenced by ffeatools.modules.FFEA_rod.py_rod_math.get_twist_angle(), ffeatools.modules.FFEA_rod.py_rod_math.perpendicularize(), and ffeatools.modules.FFEA_rod.py_rod_math.rodrigues().

◆ omega()

def ffeatools.modules.FFEA_rod.py_rod_math.omega (   self,
  pi,
  pim1,
  m2j,
  m1j 
)
For for two elements and two material frame bectors, return the 2-vector
omega. For more information on this, please check the bend energy functions
in rod_math.

◆ parallel_transport()

def ffeatools.modules.FFEA_rod.py_rod_math.parallel_transport (   self,
  m_i,
  a,
  b 
)
Given one of the material frame vectors m_i, and two vectors, a, and b,
this function transports the material frame from the basis of a to the
basis of b.

◆ perpendicularize()

def ffeatools.modules.FFEA_rod.py_rod_math.perpendicularize (   self,
  m_i,
  p_i 
)
Make two vectors perpendicular. Usually used to make the material axes and elements parallel.
 \f[\widetilde{m_{1 i}}' = \widetilde{m_{1 i}} - ( \widetilde{m_{1 i}} \cdot \widetilde{l_i}) \widetilde{\hat{l_i}}\f]
 where \f$l\f$ is the normalized tangent, \f$m\f$ is the current material frame and \f$m'\f$ is the new one.
Params:
     m_i: material axis (to be perpendicularized), a 1d array
     p_i: element, a 1d array
Returns:
    m_i_prime, the perpendicularized material axis, 1 1d array.

◆ rodrigues()

def ffeatools.modules.FFEA_rod.py_rod_math.rodrigues (   self,
  v,
  k,
  theta 
)
A python version of the rogrigues rotation of a vector V about an axis
K, by an angle theta.
Params: v, the vector (list, numpy, whatever), k, a vector, theta, a float
Return: v_prime, the rotated vector (a numpy array)

The documentation for this class was generated from the following file: