Ejemplo n.º 1
0
    def getTangentStiffness(self, elemdat):

        sData = getElemShapeData(elemdat.coords)

        kin = Kinematics(3, 6)

        elemdat.outlabel.append(["s11", "s22", "s33", "s23", "s13", "s12"])

        elemdat.outdata = zeros(shape=(len(elemdat.nodes), 6))

        for iData in sData:

            b = self.getBmatrix(iData.dhdx)

            kin.strain = dot(b, elemdat.state)
            kin.dstrain = dot(b, elemdat.Dstate)

            sigma, tang = self.mat.getStress(kin)

            elemdat.stiff += dot(b.transpose(), dot(tang, b)) * iData.weight
            elemdat.fint += dot(b.transpose(), sigma) * iData.weight

            elemdat.outdata += outer(ones(len(elemdat.nodes)), sigma)

        elemdat.outdata *= 1.0 / len(sData)
 def getTangentStiffness(self, element_data):
     sData = getElemShapeData(element_data.coords)
     kinematic = Kinematics(2, 3)
     element_data.outlabel.append("stresses")
     element_data.outdata = zeros(shape=(len(element_data.nodes), 3))
     for iData in sData:
         B_matrix = self.getBmatrix(iData.dhdx)
         kinematic.strain = dot(B_matrix, element_data.state)
         kinematic.dstrain = dot(B_matrix, element_data.Dstate)
         sigma, tangent_moduli = self.mat.getStress(kinematic)
         element_data.stiff += dot(B_matrix.transpose(),
                                   dot(tangent_moduli,
                                       B_matrix)) * iData.weight
         element_data.fint += dot(B_matrix.transpose(),
                                  sigma) * iData.weight
         element_data.outdata += outer(ones(len(element_data.nodes)), sigma)
     element_data.outdata *= 1.0 / len(sData)
Ejemplo n.º 3
0
    def getDissipation(self, elemdat):

        rot = self.getRotation(elemdat.coords, elemdat.state)

        sData = getElemShapeData(elemdat.coords[:2, :],
                                 method=self.intMethod,
                                 elemType="Line2")

        kin = Kinematics(2, 2)

        for iData in sData:
            B = self.getBmatrix(iData.h, rot)
            kin.strain = dot(B, elemdat.state)

            sigma, tang = self.mat.getStress(kin)

            elemdat.fint += dot(B.transpose(), kin.dgdstrain) * iData.weight
            elemdat.diss += kin.g * iData.weight
Ejemplo n.º 4
0
  def getInternalForce ( self, elemdat ):
   
    rot = self.getRotation( elemdat.coords , elemdat.state )

    sData = getElemShapeData( elemdat.coords[:2,:] , method = self.intMethod , elemType = "Line2" )
    
    elemdat.outlabel.append("tractions")
    elemdat.outdata  = zeros( shape=(len(elemdat.nodes),2) )

    kin = Kinematics(2,2)

    for iData in sData:
      B              = self.getBmatrix( iData.h , rot )
      kin.strain     = dot( B , elemdat.state )

      sigma,tang = self.mat.getStress( kin )
     
      elemdat.fint  += dot ( B.transpose() , sigma ) * iData.weight
      
      elemdat.outdata += outer( ones(len(elemdat.nodes)), sigma )
Ejemplo n.º 5
0
  def getInternalForce ( self, elemdat ):
   
    rot = self.getRotation( elemdat.coords , elemdat.state )

    sData = getElemShapeData( elemdat.coords[:2,:] , method = self.intMethod , elemType = "Line2" )
    
    elemdat.outlabel.append(["tn","ts","vn","vs"])
    elemdat.outdata  = zeros( shape=(len(elemdat.nodes),4) )

    kin = Kinematics(2,2)

    for (i,iData) in enumerate(sData):
      B              = self.getBmatrix( iData.h , rot )
      kin.strain     = dot( B , elemdat.state )

      sigma,tang = self.mat.getStress( kin )
     
      elemdat.fint  += dot ( B.transpose() , sigma ) * iData.weight
      
      elemdat.outdata += outer( self.m[i:i+4], hstack([sigma,kin.strain]) )
Ejemplo n.º 6
0
    def getInternalForce(self, elemdat):

        sData = getElemShapeData(elemdat.coords)

        kin = Kinematics(3, 6)

        elemdat.outlabel.append(["s11", "s22", "s33", "s23", "s13", "s12"])

        elemdat.outdata = zeros(shape=(len(elemdat.nodes), 6))

        for iData in sData:
            b = self.getBmatrix(iData.dhdx)

            kin.strain = dot(b, elemdat.state)
            kin.dstrain = dot(b, elemdat.Dstate)

            sigma, tang = self.mat.getStress(kin)

            elemdat.fint += dot(b.transpose(), sigma) * iData.weight

            self.appendNodalOutput(self.mat.outLabels(), self.mat.outData())
Ejemplo n.º 7
0
  def getInternalForce ( self, elemdat ):
      
    sData = getElemShapeData( elemdat.coords )

    elemdat.outlabel.append("stresses")
    elemdat.outdata  = zeros( shape=(len(elemdat.nodes),3) )

    kin = Kinematics(2,3)

    for iData in sData:
      b = self.getBmatrix( iData.dhdx )

      kin.strain  = dot ( b , elemdat.state )
      kin.dstrain = dot ( b , elemdat.Dstate )

      sigma,tang = self.mat.getStress( kin )

      elemdat.fint    += dot ( b.transpose() , sigma ) * iData.weight
      elemdat.outdata += outer( ones(len(self)), sigma )
      
    elemdat.outdata *= 1.0 / len(sData)  
Ejemplo n.º 8
0
    def getInternalForce(self, elemdat):

        sData = getElemShapeData(elemdat.coords)

        elemdat.outlabel.append("stresses")
        elemdat.outdata = zeros(shape=(len(elemdat.nodes), 3))

        kin = Kinematics(2, 3)

        for iData in sData:
            b = self.getBmatrix(iData.dhdx)

            kin.strain = dot(b, elemdat.state)
            kin.dstrain = dot(b, elemdat.Dstate)

            sigma, tang = self.mat.getStress(kin)

            elemdat.fint += dot(b.transpose(), sigma) * iData.weight
            elemdat.outdata += outer(ones(len(self)), sigma)

        elemdat.outdata *= 1.0 / len(sData)
Ejemplo n.º 9
0
    def getInternalForce(self, elemdat):

        rot = self.getRotation(elemdat.coords, elemdat.state)

        sData = getElemShapeData(elemdat.coords[:2, :],
                                 method=self.intMethod,
                                 elemType="Line2")

        elemdat.outlabel.append("tractions")
        elemdat.outdata = zeros(shape=(len(elemdat.nodes), 2))

        kin = Kinematics(2, 2)

        for iData in sData:
            B = self.getBmatrix(iData.h, rot)
            kin.strain = dot(B, elemdat.state)

            sigma, tang = self.mat.getStress(kin)

            elemdat.fint += dot(B.transpose(), sigma) * iData.weight

            elemdat.outdata += outer(ones(len(elemdat.nodes)), sigma)
 def getInternalForce(self, element_data):
     sData = getElemShapeData(element_data.coords)
     element_data.outlabel.append("stresses")
     element_data.outlabel.append("stress_elements")
     element_data.stress_elements = zeros(shape=(len(element_data.nodes),
                                                 3),
                                          dtype=float)
     element_data.outdata = zeros(shape=(len(element_data.nodes), 3))
     kinematic = Kinematics(2, 3)
     for iData in sData:
         B_matrix = self.getBmatrix(iData.dhdx)
         kinematic.strain = dot(B_matrix, element_data.state)
         kinematic.dstrain = dot(B_matrix, element_data.Dstate)
         sigma, tangentModuli = self.mat.getStress(
             kinematic)  #  Original code
         #sigma = self.mat.mat.sigma  # Minh's modification code
         element_data.fint += dot(B_matrix.transpose(),
                                  sigma) * iData.weight
         element_data.outdata += outer(ones(len(self)), sigma)
         element_data.stress_elements += outer(ones(len(self)), sigma)
     element_data.outdata *= 1.0 / len(sData)
     element_data.stress_elements *= 1.0 / len(sData)
Ejemplo n.º 11
0
    def getTangentStiffness(self, elemdat):

        rot = self.getRotation(elemdat.coords, elemdat.state)

        sData = getElemShapeData(elemdat.coords[:2, :],
                                 method=self.intMethod,
                                 elemType="Line2")

        elemdat.outlabel.append(["tn", "ts", "vn", "vs"])
        elemdat.outdata = zeros(shape=(len(elemdat.nodes), 4))

        kin = Kinematics(2, 2)

        for (i, iData) in enumerate(sData):
            B = self.getBmatrix(iData.h, rot)
            kin.strain = dot(B, elemdat.state)

            sigma, tang = self.mat.getStress(kin)

            elemdat.stiff += dot(B.transpose(), dot(tang, B)) * iData.weight
            elemdat.fint += dot(B.transpose(), sigma) * iData.weight

            self.appendNodalOutput(self.mat.outLabels(), self.mat.outData())