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.
Variables
generate_total_lagrangian_mixed_volumetric_strain_element Namespace Reference

Variables

string mode = "c"
 
list dim_vect = [2, 3]
 
bool do_simplifications = False
 
string output_filename = "total_lagrangian_mixed_volumetric_strain_element.cpp"
 
string template_filename = "total_lagrangian_mixed_volumetric_strain_element_template.cpp"
 
list tokens_filenames = []
 
int n_nodes = dim + 1
 
int block_size = dim + 1
 
int local_size = n_nodes * block_size
 
int strain_size = 3
 
bool impose_partion_of_unity = False
 
 N
 
 DN
 
 u = DefineMatrix('u',n_nodes,dim)
 
 b = DefineMatrix('b',n_nodes,dim)
 
 th = DefineVector('th',n_nodes)
 
 w = DefineMatrix('w',n_nodes,dim)
 
 q = DefineVector('q',n_nodes)
 
 w_g = sympy.Symbol("w_g", positive=True)
 
 tau_u = sympy.Symbol("tau_u",positive=True)
 
 tau_th = sympy.Symbol("tau_th",positive=True)
 
 S = DefineVector('S',strain_size)
 
 C = DefineSymmetricMatrix("C",strain_size,strain_size)
 
int th_gauss = 0
 
 grad_th_gauss = DN.transpose()*th
 
 b_gauss = DefineVector('b_gauss',dim)
 
 grad_w_gauss = w.transpose()*DN
 
 grad_q_gauss = q.transpose()*DN
 
 w_gauss = w.transpose()*N
 
 q_gauss = q.transpose()*N
 
 F_gauss = sympy.Matrix(sympy.eye(dim,dim))
 
 j_gauss = sympy.det(F_gauss)
 
 invF_gauss = F_gauss.inv(method="LU")
 
 cofF_gauss = j_gauss*(invF_gauss.transpose())
 
tuple Fbar_gauss = (1/j_gauss**sympy.Rational(1,dim))*F_gauss
 
tuple Cbar_gauss = Fbar_gauss.transpose() * Fbar_gauss
 
float Ebar_gauss = 0.5*(Cbar_gauss - sympy.eye(dim,dim))
 
tuple Fmod_gauss = ((1.0 + th_gauss)**sympy.Rational(1,dim))*Fbar_gauss
 
tuple Cmod_gauss = Fmod_gauss.transpose() * Fmod_gauss
 
float Emod_gauss = 0.5*(Cmod_gauss - sympy.eye(dim,dim))
 
tuple tmp = (DoubleContraction(C, F_gauss.transpose()*F_gauss)).tomatrix()
 
 mom_first = DoubleContraction(grad_w_gauss, F_gauss* S)
 
tuple mom_second = (w_gauss.transpose() * b_gauss)[0]
 
tuple mom_aux_scalar = (tau_th / dim) * ((1+th_gauss)**sympy.Rational(2-dim,dim)) * (1.0/j_gauss**sympy.Rational(2,dim))
 
 mom_stab = DoubleContraction(grad_w_gauss, mom_aux_scalar * (1 + th_gauss - j_gauss) * tmp)
 
tuple mass_first = (1.0 - tau_th) * q_gauss[0] * (1.0+th_gauss - j_gauss)
 
tuple mass_aux_scalar = (tau_u / dim) * ((j_gauss / (1.0+th_gauss))**sympy.Rational(dim-2,dim))
 
tuple mass_stab_1 = (mass_aux_scalar * grad_q_gauss * tmp * grad_th_gauss)[0]
 
tuple mass_stab_2 = (tau_u * grad_q_gauss * cofF_gauss.transpose() * b_gauss)[0]
 
tuple functional = mom_second - mom_first + mom_stab + mass_first + mass_stab_1 + mass_stab_2
 
 functional_array = sympy.Matrix([functional])
 
 dofs = sympy.zeros(local_size, 1)
 
 testfunc = sympy.zeros(local_size, 1)
 
 rhs = Compute_RHS(functional_array.copy(), testfunc, do_simplifications)
 
 rhs_out = OutputVector_CollectingFactors(w_g*rhs, "rRightHandSideVector", mode, indentation_level=2, assignment_op="+=")
 
 E = sympy.MatrixSymbol("E", dim, dim).as_mutable()
 
 S_func = sympy.MatrixSymbol("S", dim, dim).as_mutable()
 
 n_dofs = rhs.shape[0]
 
dictionary substitution_list = {}
 
 t = sympy.diff(S_func[i, j], E[k, l])
 
 lhs = sympy.zeros(n_dofs, n_dofs)
 
 lhs_out = OutputMatrix_CollectingFactors(w_g*lhs, "rLeftHandSideMatrix", mode, indentation_level=2, assignment_op="+=")
 
 Fmod_gauss_out = OutputMatrix_CollectingFactors(Fmod_gauss, "r_eq_def_gradient", mode, indentation_level=1)
 
 det_Fmod_gauss_out = OutputScalar_CollectingFactors(Fmod_gauss.det(), "r_det_eq_def_gradient", mode, indentation_level=0)
 
 Emod_gauss_out = OutputVector_CollectingFactors(StrainToVoigt(Emod_gauss), "r_eq_green_strain", mode, indentation_level=1)
 
dictionary tokens_dict
 
bool has_token = False
 

Variable Documentation

◆ b

generate_total_lagrangian_mixed_volumetric_strain_element.b = DefineMatrix('b',n_nodes,dim)

◆ b_gauss

generate_total_lagrangian_mixed_volumetric_strain_element.b_gauss = DefineVector('b_gauss',dim)

◆ block_size

int generate_total_lagrangian_mixed_volumetric_strain_element.block_size = dim + 1

◆ C

generate_total_lagrangian_mixed_volumetric_strain_element.C = DefineSymmetricMatrix("C",strain_size,strain_size)

◆ Cbar_gauss

tuple generate_total_lagrangian_mixed_volumetric_strain_element.Cbar_gauss = Fbar_gauss.transpose() * Fbar_gauss

◆ Cmod_gauss

tuple generate_total_lagrangian_mixed_volumetric_strain_element.Cmod_gauss = Fmod_gauss.transpose() * Fmod_gauss

◆ cofF_gauss

generate_total_lagrangian_mixed_volumetric_strain_element.cofF_gauss = j_gauss*(invF_gauss.transpose())

◆ det_Fmod_gauss_out

generate_total_lagrangian_mixed_volumetric_strain_element.det_Fmod_gauss_out = OutputScalar_CollectingFactors(Fmod_gauss.det(), "r_det_eq_def_gradient", mode, indentation_level=0)

◆ dim_vect

list generate_total_lagrangian_mixed_volumetric_strain_element.dim_vect = [2, 3]

◆ DN

generate_total_lagrangian_mixed_volumetric_strain_element.DN

◆ do_simplifications

bool generate_total_lagrangian_mixed_volumetric_strain_element.do_simplifications = False

◆ dofs

generate_total_lagrangian_mixed_volumetric_strain_element.dofs = sympy.zeros(local_size, 1)

◆ E

generate_total_lagrangian_mixed_volumetric_strain_element.E = sympy.MatrixSymbol("E", dim, dim).as_mutable()

◆ Ebar_gauss

float generate_total_lagrangian_mixed_volumetric_strain_element.Ebar_gauss = 0.5*(Cbar_gauss - sympy.eye(dim,dim))

◆ Emod_gauss

float generate_total_lagrangian_mixed_volumetric_strain_element.Emod_gauss = 0.5*(Cmod_gauss - sympy.eye(dim,dim))

◆ Emod_gauss_out

generate_total_lagrangian_mixed_volumetric_strain_element.Emod_gauss_out = OutputVector_CollectingFactors(StrainToVoigt(Emod_gauss), "r_eq_green_strain", mode, indentation_level=1)

◆ F_gauss

generate_total_lagrangian_mixed_volumetric_strain_element.F_gauss = sympy.Matrix(sympy.eye(dim,dim))

◆ Fbar_gauss

tuple generate_total_lagrangian_mixed_volumetric_strain_element.Fbar_gauss = (1/j_gauss**sympy.Rational(1,dim))*F_gauss

◆ Fmod_gauss

tuple generate_total_lagrangian_mixed_volumetric_strain_element.Fmod_gauss = ((1.0 + th_gauss)**sympy.Rational(1,dim))*Fbar_gauss

◆ Fmod_gauss_out

generate_total_lagrangian_mixed_volumetric_strain_element.Fmod_gauss_out = OutputMatrix_CollectingFactors(Fmod_gauss, "r_eq_def_gradient", mode, indentation_level=1)

◆ functional

tuple generate_total_lagrangian_mixed_volumetric_strain_element.functional = mom_second - mom_first + mom_stab + mass_first + mass_stab_1 + mass_stab_2

◆ functional_array

generate_total_lagrangian_mixed_volumetric_strain_element.functional_array = sympy.Matrix([functional])

◆ grad_q_gauss

generate_total_lagrangian_mixed_volumetric_strain_element.grad_q_gauss = q.transpose()*DN

◆ grad_th_gauss

generate_total_lagrangian_mixed_volumetric_strain_element.grad_th_gauss = DN.transpose()*th

◆ grad_w_gauss

generate_total_lagrangian_mixed_volumetric_strain_element.grad_w_gauss = w.transpose()*DN

◆ has_token

bool generate_total_lagrangian_mixed_volumetric_strain_element.has_token = False

◆ impose_partion_of_unity

bool generate_total_lagrangian_mixed_volumetric_strain_element.impose_partion_of_unity = False

◆ invF_gauss

generate_total_lagrangian_mixed_volumetric_strain_element.invF_gauss = F_gauss.inv(method="LU")

◆ j_gauss

generate_total_lagrangian_mixed_volumetric_strain_element.j_gauss = sympy.det(F_gauss)

◆ lhs

generate_total_lagrangian_mixed_volumetric_strain_element.lhs = sympy.zeros(n_dofs, n_dofs)

◆ lhs_out

generate_total_lagrangian_mixed_volumetric_strain_element.lhs_out = OutputMatrix_CollectingFactors(w_g*lhs, "rLeftHandSideMatrix", mode, indentation_level=2, assignment_op="+=")

◆ local_size

int generate_total_lagrangian_mixed_volumetric_strain_element.local_size = n_nodes * block_size

◆ mass_aux_scalar

tuple generate_total_lagrangian_mixed_volumetric_strain_element.mass_aux_scalar = (tau_u / dim) * ((j_gauss / (1.0+th_gauss))**sympy.Rational(dim-2,dim))

◆ mass_first

tuple generate_total_lagrangian_mixed_volumetric_strain_element.mass_first = (1.0 - tau_th) * q_gauss[0] * (1.0+th_gauss - j_gauss)

◆ mass_stab_1

tuple generate_total_lagrangian_mixed_volumetric_strain_element.mass_stab_1 = (mass_aux_scalar * grad_q_gauss * tmp * grad_th_gauss)[0]

◆ mass_stab_2

tuple generate_total_lagrangian_mixed_volumetric_strain_element.mass_stab_2 = (tau_u * grad_q_gauss * cofF_gauss.transpose() * b_gauss)[0]

◆ mode

string generate_total_lagrangian_mixed_volumetric_strain_element.mode = "c"

◆ mom_aux_scalar

tuple generate_total_lagrangian_mixed_volumetric_strain_element.mom_aux_scalar = (tau_th / dim) * ((1+th_gauss)**sympy.Rational(2-dim,dim)) * (1.0/j_gauss**sympy.Rational(2,dim))

◆ mom_first

generate_total_lagrangian_mixed_volumetric_strain_element.mom_first = DoubleContraction(grad_w_gauss, F_gauss* S)

◆ mom_second

tuple generate_total_lagrangian_mixed_volumetric_strain_element.mom_second = (w_gauss.transpose() * b_gauss)[0]

◆ mom_stab

generate_total_lagrangian_mixed_volumetric_strain_element.mom_stab = DoubleContraction(grad_w_gauss, mom_aux_scalar * (1 + th_gauss - j_gauss) * tmp)

◆ N

generate_total_lagrangian_mixed_volumetric_strain_element.N

◆ n_dofs

generate_total_lagrangian_mixed_volumetric_strain_element.n_dofs = rhs.shape[0]

◆ n_nodes

int generate_total_lagrangian_mixed_volumetric_strain_element.n_nodes = dim + 1

◆ output_filename

string generate_total_lagrangian_mixed_volumetric_strain_element.output_filename = "total_lagrangian_mixed_volumetric_strain_element.cpp"

◆ q

generate_total_lagrangian_mixed_volumetric_strain_element.q = DefineVector('q',n_nodes)

◆ q_gauss

generate_total_lagrangian_mixed_volumetric_strain_element.q_gauss = q.transpose()*N

◆ rhs

generate_total_lagrangian_mixed_volumetric_strain_element.rhs = Compute_RHS(functional_array.copy(), testfunc, do_simplifications)

◆ rhs_out

generate_total_lagrangian_mixed_volumetric_strain_element.rhs_out = OutputVector_CollectingFactors(w_g*rhs, "rRightHandSideVector", mode, indentation_level=2, assignment_op="+=")

◆ S

generate_total_lagrangian_mixed_volumetric_strain_element.S = DefineVector('S',strain_size)

◆ S_func

generate_total_lagrangian_mixed_volumetric_strain_element.S_func = sympy.MatrixSymbol("S", dim, dim).as_mutable()

◆ strain_size

int generate_total_lagrangian_mixed_volumetric_strain_element.strain_size = 3

◆ substitution_list

dictionary generate_total_lagrangian_mixed_volumetric_strain_element.substitution_list = {}

◆ t

generate_total_lagrangian_mixed_volumetric_strain_element.t = sympy.diff(S_func[i, j], E[k, l])

◆ tau_th

generate_total_lagrangian_mixed_volumetric_strain_element.tau_th = sympy.Symbol("tau_th",positive=True)

◆ tau_u

generate_total_lagrangian_mixed_volumetric_strain_element.tau_u = sympy.Symbol("tau_u",positive=True)

◆ template_filename

string generate_total_lagrangian_mixed_volumetric_strain_element.template_filename = "total_lagrangian_mixed_volumetric_strain_element_template.cpp"

◆ testfunc

generate_total_lagrangian_mixed_volumetric_strain_element.testfunc = sympy.zeros(local_size, 1)

◆ th

generate_total_lagrangian_mixed_volumetric_strain_element.th = DefineVector('th',n_nodes)

◆ th_gauss

int generate_total_lagrangian_mixed_volumetric_strain_element.th_gauss = 0

◆ tmp

tuple generate_total_lagrangian_mixed_volumetric_strain_element.tmp = (DoubleContraction(C, F_gauss.transpose()*F_gauss)).tomatrix()

◆ tokens_dict

dictionary generate_total_lagrangian_mixed_volumetric_strain_element.tokens_dict
Initial value:
1 = {
2  f"substitute_rhs_{dim}D_{n_nodes}N" : rhs_out,
3  f"substitute_lhs_{dim}D_{n_nodes}N" : lhs_out,
4  f"substitute_def_gradient_{dim}D_{n_nodes}N" : Fmod_gauss_out,
5  f"substitute_det_def_gradient_{dim}D_{n_nodes}N" : det_Fmod_gauss_out,
6  f"substitute_green_strain_{dim}D_{n_nodes}N" : Emod_gauss_out}

◆ tokens_filenames

list generate_total_lagrangian_mixed_volumetric_strain_element.tokens_filenames = []

◆ u

generate_total_lagrangian_mixed_volumetric_strain_element.u = DefineMatrix('u',n_nodes,dim)

◆ w

generate_total_lagrangian_mixed_volumetric_strain_element.w = DefineMatrix('w',n_nodes,dim)

◆ w_g

generate_total_lagrangian_mixed_volumetric_strain_element.w_g = sympy.Symbol("w_g", positive=True)

◆ w_gauss

generate_total_lagrangian_mixed_volumetric_strain_element.w_gauss = w.transpose()*N