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

Functions

def SetUp2DProblem ()
 
def SetUp3DProblem ()
 
def ComputePredictorStressVector2D (Young, nu, Strain0, Strain1, Strain2)
 
def ComputePredictorStressVector3D (Young, nu, Strain0, Strain1, Strain2, Strain3, Strain4, Strain5)
 
def ComputeJ2Invariant2D (Deviator, pmean)
 
def ComputeJ2Invariant3D (Deviator, pmean)
 
def ComputeJ3Invariant2D (Deviator)
 
def ComputeJ3Invariant3D (Deviator)
 
def ComputePmean2D (StressVector)
 
def ComputePmean3D (StressVector)
 
def ComputeDamage (UniaxialStress, Threshold, Gf, L, Young, Softening)
 
def ComputeDamageLinear (UniaxialStress, Threshold, A)
 
def ComputeDamageExponential (UniaxialStress, Threshold, A)
 
def ComputeAParameterLinear (Threshold, Gf, L, Young)
 
def ComputeAParameterExponential (Threshold, Gf, L, Young)
 

Variables

int dimension = 2
 
string yield_surface = "DruckerPrager"
 
string softening = "Linear"
 
string mode = "c"
 
float J2 = 0.0;
 
 Strain0
 
 Strain1
 
 Strain2
 
 Seff
 
 Stress = (1.0 - damage)*Seff
 
 Deviator
 
 Ct
 
 Young
 
 nu
 
 threshold
 
 Gf
 
 characteristic_length
 
def pmean = ComputePmean2D(Seff)
 
 VonMisesStress = sqrt(3.0*J2)
 
def damage = ComputeDamage(VonMisesStress, threshold, Gf, characteristic_length, Young, softening)
 
float rankine_yield = 0.5 * (Seff[0] + Seff[1]) + sqrt((0.5 * (Seff[0] - Seff[1]))**2 + (Seff[2])**2)
 
 sin_phi = Symbol("sin_phi")
 
 root_3 = math.sqrt(3.0)
 
 CFL = -root_3 * (3.0 - sin_phi) / (3.0 * sin_phi - 3.0)
 
float TEN0 = 6.0 * pmean * sin_phi / (root_3 * (3.0 - sin_phi)) + sqrt(J2)
 
float DruckerPragerStress = CFL*TEN0
 
 damage_threshold = abs(threshold * (3.0 + sin_phi) / (3.0 * sin_phi - 3.0))
 
float A = 1.0 / (Gf * Young / (characteristic_length * threshold**2) - 0.5)
 
 phi = Symbol("phi")
 
 threshold_tension = Symbol("threshold_tension")
 
 threshold_compression = Symbol("threshold_compression")
 
 R = abs(threshold_compression / threshold_tension)
 
tuple Rmohr = (tan((math.pi / 4.0) + phi / 2.0))**2
 
tuple alpha_r = R / Rmohr
 
def J3 = ComputeJ3Invariant2D(Deviator)
 
float K1 = 0.5 * (1.0 + alpha_r) - 0.5 * (1.0 - alpha_r) * sin_phi;
 
float K2 = 0.5 * (1.0 + alpha_r) - 0.5 * (1.0 - alpha_r) / sin_phi;
 
float K3 = 0.5 * (1.0 + alpha_r) * sin_phi - 0.5 * (1.0 - alpha_r);
 
tuple sint3 = (-3.0 * sqrt(3.0) * J3) / (2.0 * J2 * sqrt(J2))
 
float LodeAngle = asin(sint3) / 3.0;
 
tuple ModifiedMohrCoulombStress = (2.0 * tan(math.pi * 0.25 + phi * 0.5) / cos(phi)) * ((3.0*pmean * K3 / 3.0) +sqrt(J2) * (K1 * cos(LodeAngle) - K2 * sin(LodeAngle) * sin_phi / sqrt(3.0)))
 
list Strain = [Strain0, Strain1, Strain2]
 
 out = OutputMatrix_CollectingFactors(Ct, "r_Ct", mode)
 
 Strain3
 
 Strain4
 
 Strain5
 
 norm_stress_vector = DefineVector('norm_stress_vector', 6)
 
 PrincipalStresses = DefineVector('PrincipalStresses', 3)
 
 norm_frobenius = sqrt(Seff[0]**2 + Seff[1]**2 + Seff[2]**2+Seff[3]**2 + Seff[4]**2 + Seff[5]**2)
 
 I1 = norm_stress_vector[0] + norm_stress_vector[1] + norm_stress_vector[2]
 
tuple I2 = (norm_stress_vector[0] + norm_stress_vector[2]) * norm_stress_vector[1] + norm_stress_vector[0] * norm_stress_vector[2] -norm_stress_vector[3] * norm_stress_vector[3] - norm_stress_vector[4] * norm_stress_vector[4] - norm_stress_vector[5] * norm_stress_vector[5];
 
tuple I3 = (norm_stress_vector[1] * norm_stress_vector[2] - norm_stress_vector[4] * norm_stress_vector[4]) * norm_stress_vector[0] - norm_stress_vector[1] * norm_stress_vector[5] * norm_stress_vector[5] - norm_stress_vector[2] * norm_stress_vector[3] * norm_stress_vector[3] + 2.0 * norm_stress_vector[3] * norm_stress_vector[4] * norm_stress_vector[5]
 
int II1 = I1**2
 
tuple Q = (3.0 * I2 - II1) / 9.0;
 
 cos_phi = R / (sqrt(-Q**3));
 
float phi_3 = phi / 3.0;
 
float aux1 = 2.0 * sqrt(-Q);
 
float aux2 = I1 / 3.0;
 
float deg_120 = 2.0 / 3.0 * math.pi;
 

Function Documentation

◆ ComputeAParameterExponential()

def isotropic_damage_automatic_differentiation.ComputeAParameterExponential (   Threshold,
  Gf,
  L,
  Young 
)

◆ ComputeAParameterLinear()

def isotropic_damage_automatic_differentiation.ComputeAParameterLinear (   Threshold,
  Gf,
  L,
  Young 
)

◆ ComputeDamage()

def isotropic_damage_automatic_differentiation.ComputeDamage (   UniaxialStress,
  Threshold,
  Gf,
  L,
  Young,
  Softening 
)

◆ ComputeDamageExponential()

def isotropic_damage_automatic_differentiation.ComputeDamageExponential (   UniaxialStress,
  Threshold,
  A 
)

◆ ComputeDamageLinear()

def isotropic_damage_automatic_differentiation.ComputeDamageLinear (   UniaxialStress,
  Threshold,
  A 
)

◆ ComputeJ2Invariant2D()

def isotropic_damage_automatic_differentiation.ComputeJ2Invariant2D (   Deviator,
  pmean 
)

◆ ComputeJ2Invariant3D()

def isotropic_damage_automatic_differentiation.ComputeJ2Invariant3D (   Deviator,
  pmean 
)

◆ ComputeJ3Invariant2D()

def isotropic_damage_automatic_differentiation.ComputeJ3Invariant2D (   Deviator)

◆ ComputeJ3Invariant3D()

def isotropic_damage_automatic_differentiation.ComputeJ3Invariant3D (   Deviator)

◆ ComputePmean2D()

def isotropic_damage_automatic_differentiation.ComputePmean2D (   StressVector)

◆ ComputePmean3D()

def isotropic_damage_automatic_differentiation.ComputePmean3D (   StressVector)

◆ ComputePredictorStressVector2D()

def isotropic_damage_automatic_differentiation.ComputePredictorStressVector2D (   Young,
  nu,
  Strain0,
  Strain1,
  Strain2 
)

◆ ComputePredictorStressVector3D()

def isotropic_damage_automatic_differentiation.ComputePredictorStressVector3D (   Young,
  nu,
  Strain0,
  Strain1,
  Strain2,
  Strain3,
  Strain4,
  Strain5 
)

◆ SetUp2DProblem()

def isotropic_damage_automatic_differentiation.SetUp2DProblem ( )

◆ SetUp3DProblem()

def isotropic_damage_automatic_differentiation.SetUp3DProblem ( )

Variable Documentation

◆ A

int isotropic_damage_automatic_differentiation.A = 1.0 / (Gf * Young / (characteristic_length * threshold**2) - 0.5)

◆ alpha_r

tuple isotropic_damage_automatic_differentiation.alpha_r = R / Rmohr

◆ aux1

float isotropic_damage_automatic_differentiation.aux1 = 2.0 * sqrt(-Q);

◆ aux2

float isotropic_damage_automatic_differentiation.aux2 = I1 / 3.0;

◆ CFL

isotropic_damage_automatic_differentiation.CFL = -root_3 * (3.0 - sin_phi) / (3.0 * sin_phi - 3.0)

◆ characteristic_length

isotropic_damage_automatic_differentiation.characteristic_length

◆ cos_phi

isotropic_damage_automatic_differentiation.cos_phi = R / (sqrt(-Q**3));

◆ Ct

isotropic_damage_automatic_differentiation.Ct

◆ damage

tuple isotropic_damage_automatic_differentiation.damage = ComputeDamage(VonMisesStress, threshold, Gf, characteristic_length, Young, softening)

◆ damage_threshold

isotropic_damage_automatic_differentiation.damage_threshold = abs(threshold * (3.0 + sin_phi) / (3.0 * sin_phi - 3.0))

◆ deg_120

float isotropic_damage_automatic_differentiation.deg_120 = 2.0 / 3.0 * math.pi;

◆ Deviator

isotropic_damage_automatic_differentiation.Deviator

◆ dimension

int isotropic_damage_automatic_differentiation.dimension = 2

◆ DruckerPragerStress

float isotropic_damage_automatic_differentiation.DruckerPragerStress = CFL*TEN0

◆ Gf

isotropic_damage_automatic_differentiation.Gf

◆ I1

isotropic_damage_automatic_differentiation.I1 = norm_stress_vector[0] + norm_stress_vector[1] + norm_stress_vector[2]

◆ I2

◆ I3

◆ II1

int isotropic_damage_automatic_differentiation.II1 = I1**2

◆ J2

def isotropic_damage_automatic_differentiation.J2 = 0.0;

◆ J3

def isotropic_damage_automatic_differentiation.J3 = ComputeJ3Invariant2D(Deviator)

◆ K1

float isotropic_damage_automatic_differentiation.K1 = 0.5 * (1.0 + alpha_r) - 0.5 * (1.0 - alpha_r) * sin_phi;

◆ K2

float isotropic_damage_automatic_differentiation.K2 = 0.5 * (1.0 + alpha_r) - 0.5 * (1.0 - alpha_r) / sin_phi;

◆ K3

float isotropic_damage_automatic_differentiation.K3 = 0.5 * (1.0 + alpha_r) * sin_phi - 0.5 * (1.0 - alpha_r);

◆ LodeAngle

float isotropic_damage_automatic_differentiation.LodeAngle = asin(sint3) / 3.0;

◆ mode

string isotropic_damage_automatic_differentiation.mode = "c"

◆ ModifiedMohrCoulombStress

tuple isotropic_damage_automatic_differentiation.ModifiedMohrCoulombStress = (2.0 * tan(math.pi * 0.25 + phi * 0.5) / cos(phi)) * ((3.0*pmean * K3 / 3.0) +sqrt(J2) * (K1 * cos(LodeAngle) - K2 * sin(LodeAngle) * sin_phi / sqrt(3.0)))

◆ norm_frobenius

isotropic_damage_automatic_differentiation.norm_frobenius = sqrt(Seff[0]**2 + Seff[1]**2 + Seff[2]**2+Seff[3]**2 + Seff[4]**2 + Seff[5]**2)

◆ norm_stress_vector

isotropic_damage_automatic_differentiation.norm_stress_vector = DefineVector('norm_stress_vector', 6)

◆ nu

isotropic_damage_automatic_differentiation.nu

◆ out

isotropic_damage_automatic_differentiation.out = OutputMatrix_CollectingFactors(Ct, "r_Ct", mode)

◆ phi

isotropic_damage_automatic_differentiation.phi = Symbol("phi")

◆ phi_3

float isotropic_damage_automatic_differentiation.phi_3 = phi / 3.0;

◆ pmean

def isotropic_damage_automatic_differentiation.pmean = ComputePmean2D(Seff)

◆ PrincipalStresses

isotropic_damage_automatic_differentiation.PrincipalStresses = DefineVector('PrincipalStresses', 3)

◆ Q

tuple isotropic_damage_automatic_differentiation.Q = (3.0 * I2 - II1) / 9.0;

◆ R

tuple isotropic_damage_automatic_differentiation.R = abs(threshold_compression / threshold_tension)

◆ rankine_yield

isotropic_damage_automatic_differentiation.rankine_yield = 0.5 * (Seff[0] + Seff[1]) + sqrt((0.5 * (Seff[0] - Seff[1]))**2 + (Seff[2])**2)

◆ Rmohr

tuple isotropic_damage_automatic_differentiation.Rmohr = (tan((math.pi / 4.0) + phi / 2.0))**2

◆ root_3

isotropic_damage_automatic_differentiation.root_3 = math.sqrt(3.0)

◆ Seff

isotropic_damage_automatic_differentiation.Seff

◆ sin_phi

isotropic_damage_automatic_differentiation.sin_phi = Symbol("sin_phi")

◆ sint3

tuple isotropic_damage_automatic_differentiation.sint3 = (-3.0 * sqrt(3.0) * J3) / (2.0 * J2 * sqrt(J2))

◆ softening

string isotropic_damage_automatic_differentiation.softening = "Linear"

◆ Strain

list isotropic_damage_automatic_differentiation.Strain = [Strain0, Strain1, Strain2]

◆ Strain0

isotropic_damage_automatic_differentiation.Strain0

◆ Strain1

isotropic_damage_automatic_differentiation.Strain1

◆ Strain2

isotropic_damage_automatic_differentiation.Strain2

◆ Strain3

isotropic_damage_automatic_differentiation.Strain3

◆ Strain4

isotropic_damage_automatic_differentiation.Strain4

◆ Strain5

isotropic_damage_automatic_differentiation.Strain5

◆ Stress

tuple isotropic_damage_automatic_differentiation.Stress = (1.0 - damage)*Seff

◆ TEN0

float isotropic_damage_automatic_differentiation.TEN0 = 6.0 * pmean * sin_phi / (root_3 * (3.0 - sin_phi)) + sqrt(J2)

◆ threshold

isotropic_damage_automatic_differentiation.threshold

◆ threshold_compression

isotropic_damage_automatic_differentiation.threshold_compression = Symbol("threshold_compression")

◆ threshold_tension

isotropic_damage_automatic_differentiation.threshold_tension = Symbol("threshold_tension")

◆ VonMisesStress

isotropic_damage_automatic_differentiation.VonMisesStress = sqrt(3.0*J2)

◆ yield_surface

string isotropic_damage_automatic_differentiation.yield_surface = "DruckerPrager"

◆ Young

isotropic_damage_automatic_differentiation.Young