Exemplo n.º 1
0
    else:
        normalvarstring = "true"

    if normalvar == 1:
        lhs_template_begin_string += "    const array_1d<BoundedMatrix<double, TNumNodes, TDim>, SIZEDERIVATIVES1>& DeltaNormalSlave = rDerivativeData.DeltaNormalSlave;\n\n"

    for dim, nnodes, nnodes_master in zip(dim_combinations, nnodes_combinations, nnodes_master_combinations):

        # Update counter and calculate dof
        lhs_string = ""
        rhs_string = ""
        output_count += 1
        number_dof = dim * (2 * nnodes + nnodes_master)

        # Defining the unknowns
        u1 = custom_sympy_fe_utilities.DefineMatrix('u1', nnodes, dim, "Symbol")              # u1(i,j) is the current displacement of node i component j at domain 1
        u2 = custom_sympy_fe_utilities.DefineMatrix('u2', nnodes_master, dim, "Symbol")       # u2(i,j) is the current displacement of node i component j at domain 2
        u1old = custom_sympy_fe_utilities.DefineMatrix('u1old', nnodes, dim, "Symbol")        # u1(i,j) is the previous displacement of node i component j at domain 1
        u2old = custom_sympy_fe_utilities.DefineMatrix('u2old', nnodes_master, dim, "Symbol") # u2(i,j) is the previous displacement of node i component j at domain 2
        LM = custom_sympy_fe_utilities.DefineMatrix('LM', nnodes, dim, "Symbol")              # Lm are the Lagrange multipliers

        # Normal and tangets of the slave
        if normalvar == 1:
            NormalSlave = custom_sympy_fe_utilities.DefineMatrix('NormalSlave', nnodes, dim)
        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:
    if normalvar == 1:
        lhs_template_begin_string += "    const array_1d<BoundedMatrix<double, TNumNodes, TDim>, SIZEDERIVATIVES1>& DeltaNormalSlave = rDerivativeData.DeltaNormalSlave;\n\n"

    for dim, nnodes, nnodes_master in zip(dim_combinations,
                                          nnodes_combinations,
                                          nnodes_master_combinations):

        # 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)