Local coordinate system in solid mechanics.
I would like to try fenics for solid mechanics of composites, first by modeling a bi-layered laminate with 0 and 90° fiber directions, respectively under uniaxial extension.
My question is,
how can one rotate the strains (into the local coordinate system), operate at an element level and rotate back the stresses in the global coordinate system to perform such an analysis?
def metricFromBasis(a0,a1): return as_matrix(((inner(a0,a0),inner(a0,a1)), (inner(a1,a0),inner(a1,a1)))) # change of basis of T w/ two lowered indices from a to e def changeBasis(T,a0,a1,e0,e1): # raise indices on from basis a = metricFromBasis(a0,a1) ac = inv(a) a0c = ac[0,0]*a0 + ac[0,1]*a1 a1c = ac[1,0]*a0 + ac[1,1]*a1 # change-of-basis matrices ea = as_matrix(((inner(e0,a0c),inner(e0,a1c)), (inner(e1,a0c),inner(e1,a1c)))) ae = ea.T # apply and return return ea*T*ae
If both of your bases are orthonormal, this can be simplified somewhat, since the metric components will always form the identity matrix, and the distinction between raised/lowered indices is unnecessary.
The basic idea would be to use these routines like:
# Global Cartesian basis: e0 = Constant((1.0,0.0)) e1 = Constant((0.0,1.0)) # strain in the global basis eps = ... # Local basis vectors expressed in the same basis as e0,e1 a0,a1 = ... strainLoc = changeBasis(eps,e0,e1,a0,a1) # stress in local basis, expressed in terms of strainLoc stressLoc = ... stress = changeBasis(stressLoc,a0,a1,e0,e1)