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 | |
def | convert_active_inactive_int (list_active) |
Variables | |
bool | do_simplifications = False |
string | mode = "c" |
bool | impose_partion_of_unity = False |
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_string = "" |
SUBSTITUTION ################################. More... | |
string | lhs_template_begin_string = "\n/***********************************************************************************/\n/***********************************************************************************/\n\ntemplate<>\nvoid AugmentedLagrangianMethodFrictionlessMortarContactCondition<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 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 array_1d<double, TNumNodes> LMNormal = MortarUtilities::GetVariableVector<TNumNodes>(this->GetParentGeometry(), LAGRANGE_MULTIPLIER_CONTACT_PRESSURE, 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_string = "" |
string | rhs_template_begin_string = "\n/***********************************************************************************/\n/***********************************************************************************/\n\ntemplate<>\nvoid AugmentedLagrangianMethodFrictionlessMortarContactCondition<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 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 array_1d<double, TNumNodes> LMNormal = MortarUtilities::GetVariableVector<TNumNodes>(this->GetParentGeometry(), LAGRANGE_MULTIPLIER_CONTACT_PRESSURE, 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" |
number_dof = dim * (nnodes_master + nnodes) + nnodes | |
active_inactive_combinations = list(ibin(nnodes, 'all')) | |
int | active_inactive_comb = 0 |
u1 = custom_sympy_fe_utilities.DefineMatrix('u1',nnodes,dim) | |
u2 = custom_sympy_fe_utilities.DefineMatrix('u2',nnodes_master,dim) | |
LMNormal = custom_sympy_fe_utilities.DefineVector('LMNormal',nnodes) | |
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) | |
wLMNormal = custom_sympy_fe_utilities.DefineVector('wLMNormal',nnodes) | |
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... | |
active = active_inactive[node] | |
tuple | augmented_contact_pressure = (ScaleFactor * LMNormal[node] + PenaltyParameter[node] * NormalGap[node]) |
rv = sympy.Matrix( sympy.zeros(1, 1) ) | |
Complete functional. More... | |
rhs | |
lhs | |
lhs_out = custom_sympy_fe_utilities.OutputMatrix_CollectingFactors(lhs,"lhs", mode, 1, number_dof) | |
rhs_out = custom_sympy_fe_utilities.OutputVector_CollectingFactors(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 = [] |
input = open("ALM_frictionless_mortar_contact_condition_template.cpp",'r').read() | |
FINAL SAVING ##############################. More... | |
outputstring = input.replace("// replace_lhs", lhs_string) | |
output = open("ALM_frictionless_mortar_contact_condition.cpp",'w') | |
def generate_frictionless_mortar_condition.convert_active_inactive_int | ( | list_active | ) |
generate_frictionless_mortar_condition.active = active_inactive[node] |
int generate_frictionless_mortar_condition.active_inactive_comb = 0 |
generate_frictionless_mortar_condition.active_inactive_combinations = list(ibin(nnodes, 'all')) |
list generate_frictionless_mortar_condition.all_var = u12_var.copy() |
tuple generate_frictionless_mortar_condition.augmented_contact_pressure = (ScaleFactor * LMNormal[node] + PenaltyParameter[node] * NormalGap[node]) |
int generate_frictionless_mortar_condition.count = 0 |
generate_frictionless_mortar_condition.der_var_list = [] |
generate_frictionless_mortar_condition.der_var_strings = [] |
list generate_frictionless_mortar_condition.der_var_used_index = [] |
list generate_frictionless_mortar_condition.dim_combinations = [2,3,3,3,3] |
bool generate_frictionless_mortar_condition.do_simplifications = False |
generate_frictionless_mortar_condition.dofs = sympy.Matrix( sympy.zeros(number_dof, 1) ) |
generate_frictionless_mortar_condition.DOperator = custom_sympy_fe_utilities.DefineMatrix('DOperator',nnodes,nnodes) |
generate_frictionless_mortar_condition.DynamicFactor = custom_sympy_fe_utilities.DefineVector('DynamicFactor',nnodes) |
bool generate_frictionless_mortar_condition.impose_partion_of_unity = False |
generate_frictionless_mortar_condition.input = open("ALM_frictionless_mortar_contact_condition_template.cpp",'r').read() |
FINAL SAVING ##############################.
generate_frictionless_mortar_condition.lhs |
generate_frictionless_mortar_condition.lhs_out = custom_sympy_fe_utilities.OutputMatrix_CollectingFactors(lhs,"lhs", mode, 1, number_dof) |
string generate_frictionless_mortar_condition.lhs_string = "" |
SUBSTITUTION ################################.
SIMPLIFICATION ##############################.
string generate_frictionless_mortar_condition.lhs_template_begin_string = "\n/***********************************************************************************/\n/***********************************************************************************/\n\ntemplate<>\nvoid AugmentedLagrangianMethodFrictionlessMortarContactCondition<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 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 array_1d<double, TNumNodes> LMNormal = MortarUtilities::GetVariableVector<TNumNodes>(this->GetParentGeometry(), LAGRANGE_MULTIPLIER_CONTACT_PRESSURE, 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 generate_frictionless_mortar_condition.lhs_template_end_string = "\n}\n" |
list generate_frictionless_mortar_condition.lm_var = [] |
generate_frictionless_mortar_condition.LMNormal = custom_sympy_fe_utilities.DefineVector('LMNormal',nnodes) |
string generate_frictionless_mortar_condition.mode = "c" |
generate_frictionless_mortar_condition.MOperator = custom_sympy_fe_utilities.DefineMatrix('MOperator',nnodes,nnodes_master) |
list generate_frictionless_mortar_condition.nnodes_combinations = [2,3,4,3,4] |
list generate_frictionless_mortar_condition.nnodes_master_combinations = [2,3,4,4,3] |
int generate_frictionless_mortar_condition.normal_combs = 2 |
generate_frictionless_mortar_condition.NormalGap = custom_sympy_fe_utilities.DefineVector('NormalGap',nnodes) |
generate_frictionless_mortar_condition.NormalSlave = custom_sympy_fe_utilities.DefineMatrix('NormalSlave',nnodes,dim) |
string generate_frictionless_mortar_condition.normalvarstring = "false" |
generate_frictionless_mortar_condition.number_dof = dim * (nnodes_master + nnodes) + nnodes |
generate_frictionless_mortar_condition.output = open("ALM_frictionless_mortar_contact_condition.cpp",'w') |
int generate_frictionless_mortar_condition.output_count = 0 |
generate_frictionless_mortar_condition.outputstring = input.replace("// replace_lhs", lhs_string) |
generate_frictionless_mortar_condition.PenaltyParameter = custom_sympy_fe_utilities.DefineVector('PenaltyParameter',nnodes) |
generate_frictionless_mortar_condition.rhs |
generate_frictionless_mortar_condition.rhs_out = custom_sympy_fe_utilities.OutputVector_CollectingFactors(rhs,"rhs", mode, 1, number_dof) |
string generate_frictionless_mortar_condition.rhs_string = "" |
string generate_frictionless_mortar_condition.rhs_template_begin_string = "\n/***********************************************************************************/\n/***********************************************************************************/\n\ntemplate<>\nvoid AugmentedLagrangianMethodFrictionlessMortarContactCondition<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 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 array_1d<double, TNumNodes> LMNormal = MortarUtilities::GetVariableVector<TNumNodes>(this->GetParentGeometry(), LAGRANGE_MULTIPLIER_CONTACT_PRESSURE, 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 generate_frictionless_mortar_condition.rhs_template_end_string = "\n}\n" |
generate_frictionless_mortar_condition.rv = sympy.Matrix( sympy.zeros(1, 1) ) |
Complete functional.
generate_frictionless_mortar_condition.rv_galerkin = 0 |
FUNCTIONAL DEFINITION ############################.
generate_frictionless_mortar_condition.ScaleFactor = sympy.Symbol('ScaleFactor', positive=True) |
generate_frictionless_mortar_condition.testfunc = sympy.Matrix( sympy.zeros(number_dof, 1) ) |
int generate_frictionless_mortar_condition.total_combs = normal_combs * len(nnodes_combinations) |
generate_frictionless_mortar_condition.u1 = custom_sympy_fe_utilities.DefineMatrix('u1',nnodes,dim) |
list generate_frictionless_mortar_condition.u12_var = u1_var.copy() |
list generate_frictionless_mortar_condition.u1_lm_var = u1_var.copy() |
list generate_frictionless_mortar_condition.u1_var = [] |
generate_frictionless_mortar_condition.u2 = custom_sympy_fe_utilities.DefineMatrix('u2',nnodes_master,dim) |
list generate_frictionless_mortar_condition.u2_var = [] |
generate_frictionless_mortar_condition.var_strings = [] |
DEFINE VARIABLES AND DERIVATIVES #######################.
generate_frictionless_mortar_condition.var_strings_aux_subs = [] |
generate_frictionless_mortar_condition.var_strings_subs = [] |
generate_frictionless_mortar_condition.w1 = custom_sympy_fe_utilities.DefineMatrix('w1',nnodes,dim) |
generate_frictionless_mortar_condition.w2 = custom_sympy_fe_utilities.DefineMatrix('w2',nnodes_master,dim) |
generate_frictionless_mortar_condition.wLMNormal = custom_sympy_fe_utilities.DefineVector('wLMNormal',nnodes) |
generate_frictionless_mortar_condition.X1 = custom_sympy_fe_utilities.DefineMatrix('X1',nnodes,dim) |
generate_frictionless_mortar_condition.X2 = custom_sympy_fe_utilities.DefineMatrix('X2',nnodes_master,dim) |