예제 #1
0
        else:
            NormalSlave = custom_sympy_fe_utilities.DefineMatrix('NormalSlave', nnodes, dim, "Symbol")

        # The resultant tangent
        if normalvar == 1:
            TangentSlave = custom_sympy_fe_utilities.DefineMatrix('TangentSlave', nnodes, dim)
        else:
            TangentSlave = custom_sympy_fe_utilities.DefineMatrix('TangentSlave', nnodes, dim, "Symbol")

        # Define test functions
        w1 = custom_sympy_fe_utilities.DefineMatrix('w1',nnodes,dim, "Symbol")
        w2 = custom_sympy_fe_utilities.DefineMatrix('w2',nnodes_master,dim, "Symbol")
        wLM = custom_sympy_fe_utilities.DefineMatrix('wLM',nnodes,dim, "Symbol")

        # Defining normal and tangent components
        LMNormal = custom_sympy_fe_utilities.DefineVector('LMNormal', nnodes)
        wLMNormal = custom_sympy_fe_utilities.DefineVector('wLMNormal', nnodes)

        # The resultant tangent LM
        LMTangent = custom_sympy_fe_utilities.DefineMatrix('LMTangent', nnodes, dim)
        wLMTangent = custom_sympy_fe_utilities.DefineMatrix('wLMTangent', nnodes, dim)

        # Defining additional variables
        NormalGap = custom_sympy_fe_utilities.DefineVector('NormalGap', nnodes)
        NormalwGap = custom_sympy_fe_utilities.DefineVector('NormalwGap', nnodes)
        TangentSlipNonObjective = custom_sympy_fe_utilities.DefineMatrix('TangentSlipNonObjective', nnodes, dim)
        TangentwSlipNonObjective = custom_sympy_fe_utilities.DefineMatrix('TangentwSlipNonObjective', nnodes, dim)
        TangentSlipObjective = custom_sympy_fe_utilities.DefineMatrix('TangentSlipObjective', nnodes, dim)
        TangentwSlipObjective = custom_sympy_fe_utilities.DefineMatrix('TangentwSlipObjective', nnodes, dim)
        DOperator = custom_sympy_fe_utilities.DefineMatrix('DOperator', nnodes, nnodes)
        MOperator = custom_sympy_fe_utilities.DefineMatrix('MOperator', nnodes, nnodes_master)
        # Update counter and clear strings
        lhs_string = ""
        rhs_string = ""
        output_count += 1
        number_dof = dim * (nnodes_master + 2 * nnodes)

        #Defining the unknowns
        u1 = custom_sympy_fe_utilities.DefineMatrix(
            'u1', nnodes,
            dim)  #u1(i,j) is displacement of node i component j at domain 1
        u2 = custom_sympy_fe_utilities.DefineMatrix(
            'u2', nnodes_master,
            dim)  #u2(i,j) is displacement of node i component j at domain 2
        LM = custom_sympy_fe_utilities.DefineMatrix('LM', nnodes, dim)
        NormalGap = custom_sympy_fe_utilities.DefineVector('NormalGap', nnodes)
        DOperator = custom_sympy_fe_utilities.DefineMatrix(
            'DOperator', nnodes, nnodes)
        MOperator = custom_sympy_fe_utilities.DefineMatrix(
            'MOperator', nnodes, nnodes_master)

        # Define other parameters
        # Normal and tangets of the slave
        NormalSlave = custom_sympy_fe_utilities.DefineMatrix(
            'NormalSlave', nnodes, dim)

        X1 = custom_sympy_fe_utilities.DefineMatrix('X1', nnodes, dim)
        X2 = custom_sympy_fe_utilities.DefineMatrix('X2', nnodes_master, dim)
        x1 = X1 + u1
        x2 = X2 + u2