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_frictionless_components_mortar_condition_non_zero Namespace Reference

Functions

def convert_active_inactive_int (list_active)
 

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 AugmentedLagrangianMethodFrictionlessComponentsMortarContactCondition<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, TNumNodesMaster, TDim>& u2 = rDerivativeData.u2;\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>(this->GetParentGeometry(), VECTOR_LAGRANGE_MULTIPLIER, 0);\n \n const BoundedMatrix<double, TNumNodes, TDim>& NormalSlave = rDerivativeData.NormalSlave;\n\n // The ALM parameters\n const array_1d<double, TNumNodes> DynamicFactor = MortarUtilities::GetVariableVector<TNumNodes>(this->GetParentGeometry(), DYNAMIC_FACTOR);\n const double ScaleFactor = rDerivativeData.ScaleFactor;\n const array_1d<double, TNumNodes>& PenaltyParameter = rDerivativeData.PenaltyParameter;\n \n // Mortar operators\n const BoundedMatrix<double, TNumNodes, TNumNodesMaster>& MOperator = rMortarConditionMatrices.MOperator;\n const BoundedMatrix<double, TNumNodes, TNumNodes>& DOperator = rMortarConditionMatrices.DOperator;\n // Mortar operators derivatives\n const array_1d<BoundedMatrix<double, TNumNodes, TNumNodesMaster>, SIZEDERIVATIVES2>& DeltaMOperator = rMortarConditionMatrices.DeltaMOperator;\n const array_1d<BoundedMatrix<double, TNumNodes, TNumNodes>, SIZEDERIVATIVES2>& DeltaDOperator = rMortarConditionMatrices.DeltaDOperator;\n\n"
 
string lhs_template_end_string = "\n}\n"
 
string rhs_template_begin_string = "\n/***********************************************************************************/\n/***********************************************************************************/\n\ntemplate<>\nvoid AugmentedLagrangianMethodFrictionlessComponentsMortarContactCondition<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, TNumNodesMaster, TDim>& u2 = rDerivativeData.u2;\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>(this->GetParentGeometry(), VECTOR_LAGRANGE_MULTIPLIER, 0);\n \n const BoundedMatrix<double, TNumNodes, TDim>& NormalSlave = rDerivativeData.NormalSlave;\n\n // The ALM parameters\n const array_1d<double, TNumNodes> DynamicFactor = MortarUtilities::GetVariableVector<TNumNodes>(this->GetParentGeometry(), DYNAMIC_FACTOR);\n const double ScaleFactor = rDerivativeData.ScaleFactor;\n const array_1d<double, TNumNodes>& PenaltyParameter = rDerivativeData.PenaltyParameter;\n \n // Mortar operators\n const BoundedMatrix<double, TNumNodes, TNumNodesMaster>& MOperator = rMortarConditionMatrices.MOperator;\n const BoundedMatrix<double, TNumNodes, TNumNodes>& DOperator = rMortarConditionMatrices.DOperator;\n\n"
 
string rhs_template_end_string = "\n}\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 * (nnodes_master + 2 * nnodes)
 
 u1 = custom_sympy_fe_utilities.DefineMatrix('u1',nnodes,dim)
 
 u2 = custom_sympy_fe_utilities.DefineMatrix('u2',nnodes_master,dim)
 
 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)
 
 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
 
 DynamicFactor = custom_sympy_fe_utilities.DefineVector('DynamicFactor',nnodes)
 
 PenaltyParameter = custom_sympy_fe_utilities.DefineVector('PenaltyParameter',nnodes)
 
 ScaleFactor = sympy.Symbol('ScaleFactor', positive=True)
 
 w1 = custom_sympy_fe_utilities.DefineMatrix('w1',nnodes,dim)
 
 w2 = custom_sympy_fe_utilities.DefineMatrix('w2',nnodes_master,dim)
 
 wLM = custom_sympy_fe_utilities.DefineMatrix('wLMN',nnodes,dim)
 
 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)
 
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
 
 Dw1Mw2 = DOperator * w1 - MOperator * w2
 
 dofs = sympy.Matrix( sympy.zeros(number_dof, 1) )
 
 testfunc = sympy.Matrix( sympy.zeros(number_dof, 1) )
 
int count = 0
 
int rv_galerkin = 0
 FUNCTIONAL DEFINITION ############################. More...
 
tuple augmented_lm = (ScaleFactor * LM.row(node) + PenaltyParameter[node] * NormalGap[node] * NormalSlave.row(node))
 
 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_frictionless_components_mortar_contact_condition_template.cpp", 'r').read()
 FINAL SAVING ##############################. More...
 
 outputstring = first_input.replace("// replace_lhs", lhs_string)
 
 input = open("ALM_frictionless_components_mortar_contact_condition.cpp", 'r').read()
 
 output = open("ALM_frictionless_components_mortar_contact_condition.cpp",'w')
 

Function Documentation

◆ convert_active_inactive_int()

def generate_frictionless_components_mortar_condition_non_zero.convert_active_inactive_int (   list_active)

Variable Documentation

◆ all_var

list generate_frictionless_components_mortar_condition_non_zero.all_var = u12_var.copy()

◆ augmented_lm

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

◆ count

int generate_frictionless_components_mortar_condition_non_zero.count = 0

◆ debug

bool generate_frictionless_components_mortar_condition_non_zero.debug = False

◆ debug_counter

int generate_frictionless_components_mortar_condition_non_zero.debug_counter = 0

◆ der_var_list

generate_frictionless_components_mortar_condition_non_zero.der_var_list = []

◆ der_var_strings

generate_frictionless_components_mortar_condition_non_zero.der_var_strings = []

◆ der_var_used_index

list generate_frictionless_components_mortar_condition_non_zero.der_var_used_index = []

◆ dim_combinations

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

◆ do_simplifications

bool generate_frictionless_components_mortar_condition_non_zero.do_simplifications = False

◆ dofs

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

◆ DOperator

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

◆ Dw1Mw2

generate_frictionless_components_mortar_condition_non_zero.Dw1Mw2 = DOperator * w1 - MOperator * w2

◆ Dx1Mx2

generate_frictionless_components_mortar_condition_non_zero.Dx1Mx2 = DOperator * x1 - MOperator * x2

◆ DynamicFactor

generate_frictionless_components_mortar_condition_non_zero.DynamicFactor = custom_sympy_fe_utilities.DefineVector('DynamicFactor',nnodes)

◆ first_input

generate_frictionless_components_mortar_condition_non_zero.first_input = open("ALM_frictionless_components_mortar_contact_condition_template.cpp", 'r').read()

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

◆ impose_partion_of_unity

bool generate_frictionless_components_mortar_condition_non_zero.impose_partion_of_unity = False

◆ input

generate_frictionless_components_mortar_condition_non_zero.input = open("ALM_frictionless_components_mortar_contact_condition.cpp", 'r').read()

◆ lhs

generate_frictionless_components_mortar_condition_non_zero.lhs

◆ lhs_out

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

◆ lhs_string

string generate_frictionless_components_mortar_condition_non_zero.lhs_string = ""

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

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

◆ lhs_template_begin_string

string generate_frictionless_components_mortar_condition_non_zero.lhs_template_begin_string = "\n/***********************************************************************************/\n/***********************************************************************************/\n\ntemplate<>\nvoid AugmentedLagrangianMethodFrictionlessComponentsMortarContactCondition<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, TNumNodesMaster, TDim>& u2 = rDerivativeData.u2;\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>(this->GetParentGeometry(), VECTOR_LAGRANGE_MULTIPLIER, 0);\n \n const BoundedMatrix<double, TNumNodes, TDim>& NormalSlave = rDerivativeData.NormalSlave;\n\n // The ALM parameters\n const array_1d<double, TNumNodes> DynamicFactor = MortarUtilities::GetVariableVector<TNumNodes>(this->GetParentGeometry(), DYNAMIC_FACTOR);\n const double ScaleFactor = rDerivativeData.ScaleFactor;\n const array_1d<double, TNumNodes>& PenaltyParameter = rDerivativeData.PenaltyParameter;\n \n // Mortar operators\n const BoundedMatrix<double, TNumNodes, TNumNodesMaster>& MOperator = rMortarConditionMatrices.MOperator;\n const BoundedMatrix<double, TNumNodes, TNumNodes>& DOperator = rMortarConditionMatrices.DOperator;\n // Mortar operators derivatives\n const array_1d<BoundedMatrix<double, TNumNodes, TNumNodesMaster>, SIZEDERIVATIVES2>& DeltaMOperator = rMortarConditionMatrices.DeltaMOperator;\n const array_1d<BoundedMatrix<double, TNumNodes, TNumNodes>, SIZEDERIVATIVES2>& DeltaDOperator = rMortarConditionMatrices.DeltaDOperator;\n\n"

◆ lhs_template_end_string

string generate_frictionless_components_mortar_condition_non_zero.lhs_template_end_string = "\n}\n"

◆ LM

generate_frictionless_components_mortar_condition_non_zero.LM = custom_sympy_fe_utilities.DefineMatrix('LM',nnodes,dim)

◆ lm_var

list generate_frictionless_components_mortar_condition_non_zero.lm_var = []

◆ LMNormal

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

◆ LMTangent

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

◆ mode

string generate_frictionless_components_mortar_condition_non_zero.mode = "c"

◆ MOperator

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

◆ nnodes_combinations

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

◆ nnodes_master_combinations

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

◆ normal_combs

int generate_frictionless_components_mortar_condition_non_zero.normal_combs = 2

◆ NormalGap

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

◆ NormalSlave

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

◆ normalvarstring

string generate_frictionless_components_mortar_condition_non_zero.normalvarstring = "false"

◆ number_dof

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

◆ output

generate_frictionless_components_mortar_condition_non_zero.output = open("ALM_frictionless_components_mortar_contact_condition.cpp",'w')

◆ output_count

int generate_frictionless_components_mortar_condition_non_zero.output_count = 0

◆ outputstring

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

◆ PenaltyParameter

generate_frictionless_components_mortar_condition_non_zero.PenaltyParameter = custom_sympy_fe_utilities.DefineVector('PenaltyParameter',nnodes)

◆ rhs

generate_frictionless_components_mortar_condition_non_zero.rhs

◆ rhs_out

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

◆ rhs_string

string generate_frictionless_components_mortar_condition_non_zero.rhs_string = ""

◆ rhs_template_begin_string

string generate_frictionless_components_mortar_condition_non_zero.rhs_template_begin_string = "\n/***********************************************************************************/\n/***********************************************************************************/\n\ntemplate<>\nvoid AugmentedLagrangianMethodFrictionlessComponentsMortarContactCondition<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, TNumNodesMaster, TDim>& u2 = rDerivativeData.u2;\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>(this->GetParentGeometry(), VECTOR_LAGRANGE_MULTIPLIER, 0);\n \n const BoundedMatrix<double, TNumNodes, TDim>& NormalSlave = rDerivativeData.NormalSlave;\n\n // The ALM parameters\n const array_1d<double, TNumNodes> DynamicFactor = MortarUtilities::GetVariableVector<TNumNodes>(this->GetParentGeometry(), DYNAMIC_FACTOR);\n const double ScaleFactor = rDerivativeData.ScaleFactor;\n const array_1d<double, TNumNodes>& PenaltyParameter = rDerivativeData.PenaltyParameter;\n \n // Mortar operators\n const BoundedMatrix<double, TNumNodes, TNumNodesMaster>& MOperator = rMortarConditionMatrices.MOperator;\n const BoundedMatrix<double, TNumNodes, TNumNodes>& DOperator = rMortarConditionMatrices.DOperator;\n\n"

◆ rhs_template_end_string

string generate_frictionless_components_mortar_condition_non_zero.rhs_template_end_string = "\n}\n"

◆ rv

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

Complete functional.

◆ rv_galerkin

generate_frictionless_components_mortar_condition_non_zero.rv_galerkin = 0

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

◆ ScaleFactor

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

◆ testfunc

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

◆ total_combs

int generate_frictionless_components_mortar_condition_non_zero.total_combs = normal_combs * len(nnodes_combinations)

◆ u1

generate_frictionless_components_mortar_condition_non_zero.u1 = custom_sympy_fe_utilities.DefineMatrix('u1',nnodes,dim)

◆ u12_var

list generate_frictionless_components_mortar_condition_non_zero.u12_var = u1_var.copy()

◆ u1_lm_var

list generate_frictionless_components_mortar_condition_non_zero.u1_lm_var = u1_var.copy()

◆ u1_var

list generate_frictionless_components_mortar_condition_non_zero.u1_var = []

◆ u2

generate_frictionless_components_mortar_condition_non_zero.u2 = custom_sympy_fe_utilities.DefineMatrix('u2',nnodes_master,dim)

◆ u2_var

list generate_frictionless_components_mortar_condition_non_zero.u2_var = []

◆ var_strings

generate_frictionless_components_mortar_condition_non_zero.var_strings = []

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

◆ var_strings_aux_subs

generate_frictionless_components_mortar_condition_non_zero.var_strings_aux_subs = []

◆ var_strings_subs

generate_frictionless_components_mortar_condition_non_zero.var_strings_subs = []

◆ w1

generate_frictionless_components_mortar_condition_non_zero.w1 = custom_sympy_fe_utilities.DefineMatrix('w1',nnodes,dim)

◆ w2

generate_frictionless_components_mortar_condition_non_zero.w2 = custom_sympy_fe_utilities.DefineMatrix('w2',nnodes_master,dim)

◆ wLM

generate_frictionless_components_mortar_condition_non_zero.wLM = custom_sympy_fe_utilities.DefineMatrix('wLMN',nnodes,dim)

◆ wLMNormal

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

◆ wLMTangent

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

◆ X1

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

◆ x1

generate_frictionless_components_mortar_condition_non_zero.x1 = X1 + u1

◆ X2

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

◆ x2

generate_frictionless_components_mortar_condition_non_zero.x2 = X2 + u2