KratosMultiphysics
KRATOS Multiphysics (Kratos) is a framework for building parallel, multi-disciplinary simulation software, aiming at modularity, extensibility, and high performance. Kratos is written in C++, and counts with an extensive Python interface.
Functions | Variables
generate_frictional_mortar_condition Namespace Reference

Functions

def convert_chain_int_int (list_slip_stick)
 
def real_norm (input)
 

Variables

bool do_simplifications = False
 
string mode = "c"
 
bool impose_partion_of_unity = False
 
bool debug = False
 
int debug_counter = 0
 
list dim_combinations = [2,3,3,3,3]
 
list nnodes_combinations = [2,3,4,3,4]
 
list nnodes_master_combinations = [2,3,4,4,3]
 
int normal_combs = 2
 
string lhs_template_begin_string = "\n/***********************************************************************************/\n/***********************************************************************************/\n\ntemplate<>\nvoid AugmentedLagrangianMethodFrictionalMortarContactCondition<TDim,TNumNodes, TNormalVariation, TNumNodesMaster>::CalculateLocalLHS(\n Matrix& rLocalLHS,\n const MortarConditionMatrices& rMortarConditionMatrices,\n const DerivativeDataType& rDerivativeData,\n const IndexType rActiveInactive,\n const ProcessInfo& rCurrentProcessInfo\n )\n{\n // Initialize\n for (std::size_t i = 0; i < MatrixSize; ++i)\n for (std::size_t j = 0; j < MatrixSize; ++j)\n rLocalLHS(i, j) = 0.0;\n\n // The geometry of the condition\n const GeometryType& r_geometry = this->GetParentGeometry();\n\n // Initialize values\n const BoundedMatrix<double, TNumNodes, TDim>& u1 = rDerivativeData.u1;\n const BoundedMatrix<double, TNumNodes, TDim>& u1old = rDerivativeData.u1old;\n const BoundedMatrix<double, TNumNodesMaster, TDim>& u2 = rDerivativeData.u2;\n const BoundedMatrix<double, TNumNodesMaster, TDim>& u2old = rDerivativeData.u2old;\n const BoundedMatrix<double, TNumNodes, TDim>& X1 = rDerivativeData.X1;\n const BoundedMatrix<double, TNumNodesMaster, TDim>& X2 = rDerivativeData.X2;\n \n const BoundedMatrix<double, TNumNodes, TDim> LM = MortarUtilities::GetVariableMatrix<TDim,TNumNodes>(r_geometry, VECTOR_LAGRANGE_MULTIPLIER, 0);\n \n // The normal and tangent vectors\n const BoundedMatrix<double, TNumNodes, TDim>& NormalSlave = rDerivativeData.NormalSlave;\n const BoundedMatrix<double, TNumNodes, TDim> TangentSlave = MortarUtilities::ComputeTangentMatrix<TNumNodes,TDim>(r_geometry);\n\n // The ALM parameters\n const array_1d<double, TNumNodes> DynamicFactor = MortarUtilities::GetVariableVector<TNumNodes>(r_geometry, DYNAMIC_FACTOR);\n const double ScaleFactor = rDerivativeData.ScaleFactor;\n const array_1d<double, TNumNodes>& PenaltyParameter = rDerivativeData.PenaltyParameter;\n const double TangentFactor = rDerivativeData.TangentFactor;\n \n // Mortar operators\n const BoundedMatrix<double, TNumNodes, TNumNodesMaster>& MOperator = rMortarConditionMatrices.MOperator;\n const BoundedMatrix<double, TNumNodes, TNumNodes>& DOperator = rMortarConditionMatrices.DOperator;\n const BoundedMatrix<double, TNumNodes, TNumNodes>& MOperatorold = mPreviousMortarOperators.MOperator;\n const BoundedMatrix<double, TNumNodes, TNumNodes>& DOperatorold = mPreviousMortarOperators.DOperator;\n\n // Mortar operators derivatives\n const array_1d<BoundedMatrix<double, TNumNodes, TNumNodes>, SIZEDERIVATIVES2>& DeltaMOperator = rMortarConditionMatrices.DeltaMOperator;\n const array_1d<BoundedMatrix<double, TNumNodes, TNumNodes>, SIZEDERIVATIVES2>& DeltaDOperator = rMortarConditionMatrices.DeltaDOperator;\n\n // We get the friction coefficient\n const array_1d<double, TNumNodes> mu = GetFrictionCoefficient();\n\n// // The delta time\n// const double delta_time = rCurrentProcessInfo[DELTA_TIME];\n\n const double OperatorThreshold = rCurrentProcessInfo[OPERATOR_THRESHOLD];\n const double norm_delta_M = norm_frobenius(MOperator - MOperatorold);\n const double norm_delta_D = norm_frobenius(DOperator - DOperatorold);\n const bool is_objetive = (norm_delta_D > OperatorThreshold && norm_delta_M > OperatorThreshold) ? true : false;\n this->Set(MODIFIED, !is_objetive);\n"
 
string lhs_template_end_string = "}\n"
 
string rhs_template_begin_string = "\n/***********************************************************************************/\n/***********************************************************************************/\n\ntemplate<>\nvoid AugmentedLagrangianMethodFrictionalMortarContactCondition<TDim,TNumNodes, TNormalVariation, TNumNodesMaster>::CalculateLocalRHS(\n Vector& rLocalRHS,\n const MortarConditionMatrices& rMortarConditionMatrices,\n const DerivativeDataType& rDerivativeData,\n const IndexType rActiveInactive,\n const ProcessInfo& rCurrentProcessInfo\n )\n{\n // Initialize\n for (std::size_t i = 0; i < MatrixSize; ++i)\n rLocalRHS[i] = 0.0;\n\n // The geometry of the condition\n const GeometryType& r_geometry = this->GetParentGeometry();\n\n // Initialize values\n const BoundedMatrix<double, TNumNodes, TDim>& u1 = rDerivativeData.u1;\n const BoundedMatrix<double, TNumNodes, TDim>& u1old = rDerivativeData.u1old;\n const BoundedMatrix<double, TNumNodesMaster, TDim>& u2 = rDerivativeData.u2;\n const BoundedMatrix<double, TNumNodesMaster, TDim>& u2old = rDerivativeData.u2old;\n const BoundedMatrix<double, TNumNodes, TDim>& X1 = rDerivativeData.X1;\n const BoundedMatrix<double, TNumNodesMaster, TDim>& X2 = rDerivativeData.X2;\n \n const BoundedMatrix<double, TNumNodes, TDim> LM = MortarUtilities::GetVariableMatrix<TDim,TNumNodes>(r_geometry, VECTOR_LAGRANGE_MULTIPLIER, 0);\n \n // The normal and tangent vectors\n const BoundedMatrix<double, TNumNodes, TDim>& NormalSlave = rDerivativeData.NormalSlave;\n const BoundedMatrix<double, TNumNodes, TDim> TangentSlave = MortarUtilities::ComputeTangentMatrix<TNumNodes,TDim>(r_geometry);\n\n // The ALM parameters\n const array_1d<double, TNumNodes> DynamicFactor = MortarUtilities::GetVariableVector<TNumNodes>(r_geometry, DYNAMIC_FACTOR);\n const double ScaleFactor = rDerivativeData.ScaleFactor;\n const array_1d<double, TNumNodes>& PenaltyParameter = rDerivativeData.PenaltyParameter;\n const double TangentFactor = rDerivativeData.TangentFactor;\n \n // Mortar operators\n const BoundedMatrix<double, TNumNodes, TNumNodesMaster>& MOperator = rMortarConditionMatrices.MOperator;\n const BoundedMatrix<double, TNumNodes, TNumNodes>& DOperator = rMortarConditionMatrices.DOperator;\n const BoundedMatrix<double, TNumNodes, TNumNodes>& MOperatorold = mPreviousMortarOperators.MOperator;\n const BoundedMatrix<double, TNumNodes, TNumNodes>& DOperatorold = mPreviousMortarOperators.DOperator;\n\n // We get the friction coefficient\n const array_1d<double, TNumNodes> mu = GetFrictionCoefficient();\n\n// // The delta time\n// const double delta_time = rCurrentProcessInfo[DELTA_TIME];\n\n const double OperatorThreshold = rCurrentProcessInfo[OPERATOR_THRESHOLD];\n const double norm_delta_M = norm_frobenius(MOperator - MOperatorold);\n const double norm_delta_D = norm_frobenius(DOperator - DOperatorold);\n const bool is_objetive = (norm_delta_D > OperatorThreshold && norm_delta_M > OperatorThreshold) ? true : false;\n this->Set(MODIFIED, !is_objetive);\n"
 
string rhs_template_end_string = "}\n"
 
int output_count = 0
 
int total_combs = normal_combs * len(nnodes_combinations)
 
string normalvarstring = "false"
 
string lhs_string = ""
 SUBSTITUTION ################################. More...
 
string rhs_string = ""
 
 number_dof = dim * (2 * nnodes + nnodes_master)
 
 u1 = custom_sympy_fe_utilities.DefineMatrix('u1', nnodes, dim, "Symbol")
 
 u2 = custom_sympy_fe_utilities.DefineMatrix('u2', nnodes_master, dim, "Symbol")
 
 u1old = custom_sympy_fe_utilities.DefineMatrix('u1old', nnodes, dim, "Symbol")
 
 u2old = custom_sympy_fe_utilities.DefineMatrix('u2old', nnodes_master, dim, "Symbol")
 
 LM = custom_sympy_fe_utilities.DefineMatrix('LM', nnodes, dim, "Symbol")
 
 NormalSlave = custom_sympy_fe_utilities.DefineMatrix('NormalSlave', nnodes, dim)
 
 TangentSlave = custom_sympy_fe_utilities.DefineMatrix('TangentSlave', nnodes, dim)
 
 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")
 
 LMNormal = custom_sympy_fe_utilities.DefineVector('LMNormal', nnodes)
 
 wLMNormal = custom_sympy_fe_utilities.DefineVector('wLMNormal', nnodes)
 
 LMTangent = custom_sympy_fe_utilities.DefineMatrix('LMTangent', nnodes, dim)
 
 wLMTangent = custom_sympy_fe_utilities.DefineMatrix('wLMTangent', nnodes, dim)
 
 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)
 
 DOperatorold = custom_sympy_fe_utilities.DefineMatrix('DOperatorold',nnodes,nnodes, "Symbol")
 
 MOperatorold = custom_sympy_fe_utilities.DefineMatrix('MOperatorold',nnodes,nnodes_master, "Symbol")
 
 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
 
 x1old = X1 + u1old
 
 x2old = X2 + u2old
 
 mu = custom_sympy_fe_utilities.DefineVector('mu',nnodes, "Symbol")
 
 DynamicFactor = custom_sympy_fe_utilities.DefineVector('DynamicFactor',nnodes, "Symbol")
 
 PenaltyParameter = custom_sympy_fe_utilities.DefineVector('PenaltyParameter',nnodes, "Symbol")
 
 delta_time = sympy.Symbol('delta_time', positive=True)
 
 ScaleFactor = sympy.Symbol('ScaleFactor', positive=True)
 
 TangentFactor = sympy.Symbol('TangentFactor', positive=True)
 
list u1_var = []
 
list u2_var = []
 
list LM_var = []
 
list u12_var = u1_var.copy()
 
list u1_LM_var = u1_var.copy()
 
list all_var = u12_var.copy()
 
 Dx1Mx2 = DOperator * x1 - MOperator * x2
 Explicit definition tangent for node in range(nnodes): aux = LMTangent.row(node)/real_norm(LMTangent.row(node)) for idim in range(dim): TangentSlave[node,idim] = aux[idim]. More...
 
 Dw1Mw2 = DOperator * w1 - MOperator * w2
 
 DDeltax1MDeltax2 = DOperator * (x1 - x1old) - MOperator * (x2 - x2old)
 
tuple DeltaDx1DeltaMx2 = (DOperator - DOperatorold) * x1 - (MOperator - MOperatorold) * x2
 
tuple DeltaDw1DeltaMw2 = (DOperator - DOperatorold) * w1 - (MOperator - MOperatorold) * w2
 
 gap_time_derivative_non_objective = - DDeltax1MDeltax2.row(node)/delta_time
 
 gap_time_derivative_non_objective_w = Dw1Mw2.row(node)/delta_time
 
tuple gap_time_derivative_objective = DeltaDx1DeltaMx2.row(node)/delta_time
 
tuple gap_time_derivative_objective_w = - DeltaDw1DeltaMw2.row(node)/delta_time
 
 auxTangentSlipNonObjective = delta_time * (gap_time_derivative_non_objective - gap_time_derivative_non_objective.dot(NormalSlave.row(node)) * NormalSlave.row(node))
 
 auxTangentwSlipNonObjective = delta_time * (gap_time_derivative_non_objective_w - gap_time_derivative_non_objective_w.dot(NormalSlave.row(node)) * NormalSlave.row(node))
 
 auxTangentSlipObjective = delta_time * (gap_time_derivative_objective - gap_time_derivative_objective.dot(NormalSlave.row(node)) * NormalSlave.row(node))
 
 auxTangentwSlipObjective = delta_time * (gap_time_derivative_objective_w - gap_time_derivative_objective_w.dot(NormalSlave.row(node)) * NormalSlave.row(node))
 
 dofs = sympy.Matrix( sympy.zeros(number_dof, 1) )
 Enforced auxTangentSlipNonObjective = delta_time * gap_time_derivative_non_objective.dot(TangentSlave.row(node)) * TangentSlave.row(node) auxTangentwSlipNonObjective = delta_time * gap_time_derivative_non_objective_w.dot(TangentSlave.row(node)) * TangentSlave.row(node) auxTangentSlipObjective = delta_time * gap_time_derivative_objective.dot(TangentSlave.row(node)) * TangentSlave.row(node) auxTangentwSlipObjective = delta_time * gap_time_derivative_objective_w.dot(TangentSlave.row(node)) * TangentSlave.row(node) More...
 
 testfunc = sympy.Matrix( sympy.zeros(number_dof, 1) )
 
int count = 0
 
int rv_galerkin = 0
 FUNCTIONAL DEFINITION ############################. More...
 
tuple augmented_normal_contact_pressure = (ScaleFactor * LMNormal[node] + PenaltyParameter[node] * NormalGap[node])
 
tuple normal_augmented_contact_pressure = augmented_normal_contact_pressure * NormalSlave.row(node)
 
tuple augmented_lm = (ScaleFactor * LM.row(node) + PenaltyParameter[node] * NormalGap[node] * NormalSlave.row(node))
 
tuple augmented_tangent_contact_pressure = - mu[node] * augmented_normal_contact_pressure * TangentSlave.row(node)
 
tuple modified_augmented_tangent_lm = ScaleFactor * LMTangent.row(node) - augmented_tangent_contact_pressure
 
 rv = sympy.Matrix(sympy.zeros(1, 1))
 Complete functional. More...
 
 rhs
 
 lhs
 
 lhs_out = custom_sympy_fe_utilities.OutputMatrix_CollectingFactorsNonZero(lhs, "lhs", mode, 1, number_dof)
 
 rhs_out = custom_sympy_fe_utilities.OutputVector_CollectingFactorsNonZero(rhs, "rhs", mode, 1, number_dof)
 
list var_strings = []
 DEFINE VARIABLES AND DERIVATIVES #######################. More...
 
list var_strings_subs = []
 
list var_strings_aux_subs = []
 
list der_var_strings = []
 
list der_var_list = []
 
list der_var_used_index = []
 
 first_input = open("ALM_frictional_mortar_contact_condition_template.cpp",'r').read()
 FINAL SAVING ##############################. More...
 
 outputstring = first_input.replace("// replace_lhs", lhs_string)
 
 input = open("ALM_frictional_mortar_contact_condition.cpp",'r').read()
 
 output = open("ALM_frictional_mortar_contact_condition.cpp",'w')
 

Function Documentation

◆ convert_chain_int_int()

def generate_frictional_mortar_condition.convert_chain_int_int (   list_slip_stick)

◆ real_norm()

def generate_frictional_mortar_condition.real_norm (   input)

Variable Documentation

◆ all_var

list generate_frictional_mortar_condition.all_var = u12_var.copy()

◆ augmented_lm

tuple generate_frictional_mortar_condition.augmented_lm = (ScaleFactor * LM.row(node) + PenaltyParameter[node] * NormalGap[node] * NormalSlave.row(node))

◆ augmented_normal_contact_pressure

tuple generate_frictional_mortar_condition.augmented_normal_contact_pressure = (ScaleFactor * LMNormal[node] + PenaltyParameter[node] * NormalGap[node])

◆ augmented_tangent_contact_pressure

generate_frictional_mortar_condition.augmented_tangent_contact_pressure = - mu[node] * augmented_normal_contact_pressure * TangentSlave.row(node)

◆ auxTangentSlipNonObjective

generate_frictional_mortar_condition.auxTangentSlipNonObjective = delta_time * (gap_time_derivative_non_objective - gap_time_derivative_non_objective.dot(NormalSlave.row(node)) * NormalSlave.row(node))

◆ auxTangentSlipObjective

generate_frictional_mortar_condition.auxTangentSlipObjective = delta_time * (gap_time_derivative_objective - gap_time_derivative_objective.dot(NormalSlave.row(node)) * NormalSlave.row(node))

◆ auxTangentwSlipNonObjective

generate_frictional_mortar_condition.auxTangentwSlipNonObjective = delta_time * (gap_time_derivative_non_objective_w - gap_time_derivative_non_objective_w.dot(NormalSlave.row(node)) * NormalSlave.row(node))

◆ auxTangentwSlipObjective

generate_frictional_mortar_condition.auxTangentwSlipObjective = delta_time * (gap_time_derivative_objective_w - gap_time_derivative_objective_w.dot(NormalSlave.row(node)) * NormalSlave.row(node))

◆ count

int generate_frictional_mortar_condition.count = 0

◆ DDeltax1MDeltax2

generate_frictional_mortar_condition.DDeltax1MDeltax2 = DOperator * (x1 - x1old) - MOperator * (x2 - x2old)

◆ debug

bool generate_frictional_mortar_condition.debug = False

◆ debug_counter

int generate_frictional_mortar_condition.debug_counter = 0

◆ delta_time

generate_frictional_mortar_condition.delta_time = sympy.Symbol('delta_time', positive=True)

◆ DeltaDw1DeltaMw2

tuple generate_frictional_mortar_condition.DeltaDw1DeltaMw2 = (DOperator - DOperatorold) * w1 - (MOperator - MOperatorold) * w2

◆ DeltaDx1DeltaMx2

tuple generate_frictional_mortar_condition.DeltaDx1DeltaMx2 = (DOperator - DOperatorold) * x1 - (MOperator - MOperatorold) * x2

◆ der_var_list

generate_frictional_mortar_condition.der_var_list = []

◆ der_var_strings

generate_frictional_mortar_condition.der_var_strings = []

◆ der_var_used_index

list generate_frictional_mortar_condition.der_var_used_index = []

◆ dim_combinations

list generate_frictional_mortar_condition.dim_combinations = [2,3,3,3,3]

◆ do_simplifications

bool generate_frictional_mortar_condition.do_simplifications = False

◆ dofs

generate_frictional_mortar_condition.dofs = sympy.Matrix( sympy.zeros(number_dof, 1) )

Enforced auxTangentSlipNonObjective = delta_time * gap_time_derivative_non_objective.dot(TangentSlave.row(node)) * TangentSlave.row(node) auxTangentwSlipNonObjective = delta_time * gap_time_derivative_non_objective_w.dot(TangentSlave.row(node)) * TangentSlave.row(node) auxTangentSlipObjective = delta_time * gap_time_derivative_objective.dot(TangentSlave.row(node)) * TangentSlave.row(node) auxTangentwSlipObjective = delta_time * gap_time_derivative_objective_w.dot(TangentSlave.row(node)) * TangentSlave.row(node)

◆ DOperator

generate_frictional_mortar_condition.DOperator = custom_sympy_fe_utilities.DefineMatrix('DOperator', nnodes, nnodes)

◆ DOperatorold

generate_frictional_mortar_condition.DOperatorold = custom_sympy_fe_utilities.DefineMatrix('DOperatorold',nnodes,nnodes, "Symbol")

◆ Dw1Mw2

generate_frictional_mortar_condition.Dw1Mw2 = DOperator * w1 - MOperator * w2

◆ Dx1Mx2

generate_frictional_mortar_condition.Dx1Mx2 = DOperator * x1 - MOperator * x2

Explicit definition tangent for node in range(nnodes): aux = LMTangent.row(node)/real_norm(LMTangent.row(node)) for idim in range(dim): TangentSlave[node,idim] = aux[idim].

◆ DynamicFactor

generate_frictional_mortar_condition.DynamicFactor = custom_sympy_fe_utilities.DefineVector('DynamicFactor',nnodes, "Symbol")

◆ first_input

generate_frictional_mortar_condition.first_input = open("ALM_frictional_mortar_contact_condition_template.cpp",'r').read()

FINAL SAVING ##############################.

◆ gap_time_derivative_non_objective

generate_frictional_mortar_condition.gap_time_derivative_non_objective = - DDeltax1MDeltax2.row(node)/delta_time

◆ gap_time_derivative_non_objective_w

generate_frictional_mortar_condition.gap_time_derivative_non_objective_w = Dw1Mw2.row(node)/delta_time

◆ gap_time_derivative_objective

tuple generate_frictional_mortar_condition.gap_time_derivative_objective = DeltaDx1DeltaMx2.row(node)/delta_time

◆ gap_time_derivative_objective_w

tuple generate_frictional_mortar_condition.gap_time_derivative_objective_w = - DeltaDw1DeltaMw2.row(node)/delta_time

◆ impose_partion_of_unity

bool generate_frictional_mortar_condition.impose_partion_of_unity = False

◆ input

generate_frictional_mortar_condition.input = open("ALM_frictional_mortar_contact_condition.cpp",'r').read()

◆ lhs

generate_frictional_mortar_condition.lhs

◆ lhs_out

generate_frictional_mortar_condition.lhs_out = custom_sympy_fe_utilities.OutputMatrix_CollectingFactorsNonZero(lhs, "lhs", mode, 1, number_dof)

◆ lhs_string

string generate_frictional_mortar_condition.lhs_string = ""

SUBSTITUTION ################################.

SIMPLIFICATION ##############################.

◆ lhs_template_begin_string

string generate_frictional_mortar_condition.lhs_template_begin_string = "\n/***********************************************************************************/\n/***********************************************************************************/\n\ntemplate<>\nvoid AugmentedLagrangianMethodFrictionalMortarContactCondition<TDim,TNumNodes, TNormalVariation, TNumNodesMaster>::CalculateLocalLHS(\n Matrix& rLocalLHS,\n const MortarConditionMatrices& rMortarConditionMatrices,\n const DerivativeDataType& rDerivativeData,\n const IndexType rActiveInactive,\n const ProcessInfo& rCurrentProcessInfo\n )\n{\n // Initialize\n for (std::size_t i = 0; i < MatrixSize; ++i)\n for (std::size_t j = 0; j < MatrixSize; ++j)\n rLocalLHS(i, j) = 0.0;\n\n // The geometry of the condition\n const GeometryType& r_geometry = this->GetParentGeometry();\n\n // Initialize values\n const BoundedMatrix<double, TNumNodes, TDim>& u1 = rDerivativeData.u1;\n const BoundedMatrix<double, TNumNodes, TDim>& u1old = rDerivativeData.u1old;\n const BoundedMatrix<double, TNumNodesMaster, TDim>& u2 = rDerivativeData.u2;\n const BoundedMatrix<double, TNumNodesMaster, TDim>& u2old = rDerivativeData.u2old;\n const BoundedMatrix<double, TNumNodes, TDim>& X1 = rDerivativeData.X1;\n const BoundedMatrix<double, TNumNodesMaster, TDim>& X2 = rDerivativeData.X2;\n \n const BoundedMatrix<double, TNumNodes, TDim> LM = MortarUtilities::GetVariableMatrix<TDim,TNumNodes>(r_geometry, VECTOR_LAGRANGE_MULTIPLIER, 0);\n \n // The normal and tangent vectors\n const BoundedMatrix<double, TNumNodes, TDim>& NormalSlave = rDerivativeData.NormalSlave;\n const BoundedMatrix<double, TNumNodes, TDim> TangentSlave = MortarUtilities::ComputeTangentMatrix<TNumNodes,TDim>(r_geometry);\n\n // The ALM parameters\n const array_1d<double, TNumNodes> DynamicFactor = MortarUtilities::GetVariableVector<TNumNodes>(r_geometry, DYNAMIC_FACTOR);\n const double ScaleFactor = rDerivativeData.ScaleFactor;\n const array_1d<double, TNumNodes>& PenaltyParameter = rDerivativeData.PenaltyParameter;\n const double TangentFactor = rDerivativeData.TangentFactor;\n \n // Mortar operators\n const BoundedMatrix<double, TNumNodes, TNumNodesMaster>& MOperator = rMortarConditionMatrices.MOperator;\n const BoundedMatrix<double, TNumNodes, TNumNodes>& DOperator = rMortarConditionMatrices.DOperator;\n const BoundedMatrix<double, TNumNodes, TNumNodes>& MOperatorold = mPreviousMortarOperators.MOperator;\n const BoundedMatrix<double, TNumNodes, TNumNodes>& DOperatorold = mPreviousMortarOperators.DOperator;\n\n // Mortar operators derivatives\n const array_1d<BoundedMatrix<double, TNumNodes, TNumNodes>, SIZEDERIVATIVES2>& DeltaMOperator = rMortarConditionMatrices.DeltaMOperator;\n const array_1d<BoundedMatrix<double, TNumNodes, TNumNodes>, SIZEDERIVATIVES2>& DeltaDOperator = rMortarConditionMatrices.DeltaDOperator;\n\n // We get the friction coefficient\n const array_1d<double, TNumNodes> mu = GetFrictionCoefficient();\n\n// // The delta time\n// const double delta_time = rCurrentProcessInfo[DELTA_TIME];\n\n const double OperatorThreshold = rCurrentProcessInfo[OPERATOR_THRESHOLD];\n const double norm_delta_M = norm_frobenius(MOperator - MOperatorold);\n const double norm_delta_D = norm_frobenius(DOperator - DOperatorold);\n const bool is_objetive = (norm_delta_D > OperatorThreshold && norm_delta_M > OperatorThreshold) ? true : false;\n this->Set(MODIFIED, !is_objetive);\n"

◆ lhs_template_end_string

string generate_frictional_mortar_condition.lhs_template_end_string = "}\n"

◆ LM

generate_frictional_mortar_condition.LM = custom_sympy_fe_utilities.DefineMatrix('LM', nnodes, dim, "Symbol")

◆ LM_var

list generate_frictional_mortar_condition.LM_var = []

◆ LMNormal

generate_frictional_mortar_condition.LMNormal = custom_sympy_fe_utilities.DefineVector('LMNormal', nnodes)

◆ LMTangent

generate_frictional_mortar_condition.LMTangent = custom_sympy_fe_utilities.DefineMatrix('LMTangent', nnodes, dim)

◆ mode

string generate_frictional_mortar_condition.mode = "c"

◆ modified_augmented_tangent_lm

tuple generate_frictional_mortar_condition.modified_augmented_tangent_lm = ScaleFactor * LMTangent.row(node) - augmented_tangent_contact_pressure

◆ MOperator

generate_frictional_mortar_condition.MOperator = custom_sympy_fe_utilities.DefineMatrix('MOperator', nnodes, nnodes_master)

◆ MOperatorold

generate_frictional_mortar_condition.MOperatorold = custom_sympy_fe_utilities.DefineMatrix('MOperatorold',nnodes,nnodes_master, "Symbol")

◆ mu

generate_frictional_mortar_condition.mu = custom_sympy_fe_utilities.DefineVector('mu',nnodes, "Symbol")

◆ nnodes_combinations

list generate_frictional_mortar_condition.nnodes_combinations = [2,3,4,3,4]

◆ nnodes_master_combinations

list generate_frictional_mortar_condition.nnodes_master_combinations = [2,3,4,4,3]

◆ normal_augmented_contact_pressure

tuple generate_frictional_mortar_condition.normal_augmented_contact_pressure = augmented_normal_contact_pressure * NormalSlave.row(node)

◆ normal_combs

int generate_frictional_mortar_condition.normal_combs = 2

◆ NormalGap

generate_frictional_mortar_condition.NormalGap = custom_sympy_fe_utilities.DefineVector('NormalGap', nnodes)

◆ NormalSlave

generate_frictional_mortar_condition.NormalSlave = custom_sympy_fe_utilities.DefineMatrix('NormalSlave', nnodes, dim)

◆ normalvarstring

string generate_frictional_mortar_condition.normalvarstring = "false"

◆ NormalwGap

generate_frictional_mortar_condition.NormalwGap = custom_sympy_fe_utilities.DefineVector('NormalwGap', nnodes)

◆ number_dof

generate_frictional_mortar_condition.number_dof = dim * (2 * nnodes + nnodes_master)

◆ output

generate_frictional_mortar_condition.output = open("ALM_frictional_mortar_contact_condition.cpp",'w')

◆ output_count

int generate_frictional_mortar_condition.output_count = 0

◆ outputstring

generate_frictional_mortar_condition.outputstring = first_input.replace("// replace_lhs", lhs_string)

◆ PenaltyParameter

generate_frictional_mortar_condition.PenaltyParameter = custom_sympy_fe_utilities.DefineVector('PenaltyParameter',nnodes, "Symbol")

◆ rhs

generate_frictional_mortar_condition.rhs

◆ rhs_out

generate_frictional_mortar_condition.rhs_out = custom_sympy_fe_utilities.OutputVector_CollectingFactorsNonZero(rhs, "rhs", mode, 1, number_dof)

◆ rhs_string

string generate_frictional_mortar_condition.rhs_string = ""

◆ rhs_template_begin_string

string generate_frictional_mortar_condition.rhs_template_begin_string = "\n/***********************************************************************************/\n/***********************************************************************************/\n\ntemplate<>\nvoid AugmentedLagrangianMethodFrictionalMortarContactCondition<TDim,TNumNodes, TNormalVariation, TNumNodesMaster>::CalculateLocalRHS(\n Vector& rLocalRHS,\n const MortarConditionMatrices& rMortarConditionMatrices,\n const DerivativeDataType& rDerivativeData,\n const IndexType rActiveInactive,\n const ProcessInfo& rCurrentProcessInfo\n )\n{\n // Initialize\n for (std::size_t i = 0; i < MatrixSize; ++i)\n rLocalRHS[i] = 0.0;\n\n // The geometry of the condition\n const GeometryType& r_geometry = this->GetParentGeometry();\n\n // Initialize values\n const BoundedMatrix<double, TNumNodes, TDim>& u1 = rDerivativeData.u1;\n const BoundedMatrix<double, TNumNodes, TDim>& u1old = rDerivativeData.u1old;\n const BoundedMatrix<double, TNumNodesMaster, TDim>& u2 = rDerivativeData.u2;\n const BoundedMatrix<double, TNumNodesMaster, TDim>& u2old = rDerivativeData.u2old;\n const BoundedMatrix<double, TNumNodes, TDim>& X1 = rDerivativeData.X1;\n const BoundedMatrix<double, TNumNodesMaster, TDim>& X2 = rDerivativeData.X2;\n \n const BoundedMatrix<double, TNumNodes, TDim> LM = MortarUtilities::GetVariableMatrix<TDim,TNumNodes>(r_geometry, VECTOR_LAGRANGE_MULTIPLIER, 0);\n \n // The normal and tangent vectors\n const BoundedMatrix<double, TNumNodes, TDim>& NormalSlave = rDerivativeData.NormalSlave;\n const BoundedMatrix<double, TNumNodes, TDim> TangentSlave = MortarUtilities::ComputeTangentMatrix<TNumNodes,TDim>(r_geometry);\n\n // The ALM parameters\n const array_1d<double, TNumNodes> DynamicFactor = MortarUtilities::GetVariableVector<TNumNodes>(r_geometry, DYNAMIC_FACTOR);\n const double ScaleFactor = rDerivativeData.ScaleFactor;\n const array_1d<double, TNumNodes>& PenaltyParameter = rDerivativeData.PenaltyParameter;\n const double TangentFactor = rDerivativeData.TangentFactor;\n \n // Mortar operators\n const BoundedMatrix<double, TNumNodes, TNumNodesMaster>& MOperator = rMortarConditionMatrices.MOperator;\n const BoundedMatrix<double, TNumNodes, TNumNodes>& DOperator = rMortarConditionMatrices.DOperator;\n const BoundedMatrix<double, TNumNodes, TNumNodes>& MOperatorold = mPreviousMortarOperators.MOperator;\n const BoundedMatrix<double, TNumNodes, TNumNodes>& DOperatorold = mPreviousMortarOperators.DOperator;\n\n // We get the friction coefficient\n const array_1d<double, TNumNodes> mu = GetFrictionCoefficient();\n\n// // The delta time\n// const double delta_time = rCurrentProcessInfo[DELTA_TIME];\n\n const double OperatorThreshold = rCurrentProcessInfo[OPERATOR_THRESHOLD];\n const double norm_delta_M = norm_frobenius(MOperator - MOperatorold);\n const double norm_delta_D = norm_frobenius(DOperator - DOperatorold);\n const bool is_objetive = (norm_delta_D > OperatorThreshold && norm_delta_M > OperatorThreshold) ? true : false;\n this->Set(MODIFIED, !is_objetive);\n"

◆ rhs_template_end_string

string generate_frictional_mortar_condition.rhs_template_end_string = "}\n"

◆ rv

generate_frictional_mortar_condition.rv = sympy.Matrix(sympy.zeros(1, 1))

Complete functional.

◆ rv_galerkin

generate_frictional_mortar_condition.rv_galerkin = 0

FUNCTIONAL DEFINITION ############################.

◆ ScaleFactor

generate_frictional_mortar_condition.ScaleFactor = sympy.Symbol('ScaleFactor', positive=True)

◆ TangentFactor

generate_frictional_mortar_condition.TangentFactor = sympy.Symbol('TangentFactor', positive=True)

◆ TangentSlave

generate_frictional_mortar_condition.TangentSlave = custom_sympy_fe_utilities.DefineMatrix('TangentSlave', nnodes, dim)

◆ TangentSlipNonObjective

generate_frictional_mortar_condition.TangentSlipNonObjective = custom_sympy_fe_utilities.DefineMatrix('TangentSlipNonObjective', nnodes, dim)

◆ TangentSlipObjective

generate_frictional_mortar_condition.TangentSlipObjective = custom_sympy_fe_utilities.DefineMatrix('TangentSlipObjective', nnodes, dim)

◆ TangentwSlipNonObjective

generate_frictional_mortar_condition.TangentwSlipNonObjective = custom_sympy_fe_utilities.DefineMatrix('TangentwSlipNonObjective', nnodes, dim)

◆ TangentwSlipObjective

generate_frictional_mortar_condition.TangentwSlipObjective = custom_sympy_fe_utilities.DefineMatrix('TangentwSlipObjective', nnodes, dim)

◆ testfunc

generate_frictional_mortar_condition.testfunc = sympy.Matrix( sympy.zeros(number_dof, 1) )

◆ total_combs

int generate_frictional_mortar_condition.total_combs = normal_combs * len(nnodes_combinations)

◆ u1

generate_frictional_mortar_condition.u1 = custom_sympy_fe_utilities.DefineMatrix('u1', nnodes, dim, "Symbol")

◆ u12_var

list generate_frictional_mortar_condition.u12_var = u1_var.copy()

◆ u1_LM_var

list generate_frictional_mortar_condition.u1_LM_var = u1_var.copy()

◆ u1_var

list generate_frictional_mortar_condition.u1_var = []

◆ u1old

generate_frictional_mortar_condition.u1old = custom_sympy_fe_utilities.DefineMatrix('u1old', nnodes, dim, "Symbol")

◆ u2

generate_frictional_mortar_condition.u2 = custom_sympy_fe_utilities.DefineMatrix('u2', nnodes_master, dim, "Symbol")

◆ u2_var

list generate_frictional_mortar_condition.u2_var = []

◆ u2old

generate_frictional_mortar_condition.u2old = custom_sympy_fe_utilities.DefineMatrix('u2old', nnodes_master, dim, "Symbol")

◆ var_strings

generate_frictional_mortar_condition.var_strings = []

DEFINE VARIABLES AND DERIVATIVES #######################.

◆ var_strings_aux_subs

generate_frictional_mortar_condition.var_strings_aux_subs = []

◆ var_strings_subs

generate_frictional_mortar_condition.var_strings_subs = []

◆ w1

generate_frictional_mortar_condition.w1 = custom_sympy_fe_utilities.DefineMatrix('w1',nnodes,dim, "Symbol")

◆ w2

generate_frictional_mortar_condition.w2 = custom_sympy_fe_utilities.DefineMatrix('w2',nnodes_master,dim, "Symbol")

◆ wLM

generate_frictional_mortar_condition.wLM = custom_sympy_fe_utilities.DefineMatrix('wLM',nnodes,dim, "Symbol")

◆ wLMNormal

generate_frictional_mortar_condition.wLMNormal = custom_sympy_fe_utilities.DefineVector('wLMNormal', nnodes)

◆ wLMTangent

generate_frictional_mortar_condition.wLMTangent = custom_sympy_fe_utilities.DefineMatrix('wLMTangent', nnodes, dim)

◆ X1

generate_frictional_mortar_condition.X1 = custom_sympy_fe_utilities.DefineMatrix('X1',nnodes,dim)

◆ x1

generate_frictional_mortar_condition.x1 = X1 + u1

◆ x1old

generate_frictional_mortar_condition.x1old = X1 + u1old

◆ X2

generate_frictional_mortar_condition.X2 = custom_sympy_fe_utilities.DefineMatrix('X2',nnodes_master,dim)

◆ x2

generate_frictional_mortar_condition.x2 = X2 + u2

◆ x2old

generate_frictional_mortar_condition.x2old = X2 + u2old