Skip to content

Commit

Permalink
A bit of reformatting for readability.
Browse files Browse the repository at this point in the history
  • Loading branch information
staleyLANL committed Apr 18, 2024
1 parent 8904845 commit 510ac96
Showing 1 changed file with 43 additions and 29 deletions.
72 changes: 43 additions & 29 deletions impala/physics/test.py
Original file line number Diff line number Diff line change
@@ -1,43 +1,57 @@

import numpy as np
import physical_models_vec as physics

consts = {
'alpha' : 0.2,
'beta' : 0.33,
'matomic': 45.9,
'Tmelt0' : 2110.,
'rho0' : 4.419,
'Cv0' : 0.525e-5,
'G0' : 0.4,
'chi' : 1.0,
'sgB' : 6.44e-4
}
'alpha' : 0.2,
'beta' : 0.33,
'matomic' : 45.9,
'Tmelt0' : 2110.,
'rho0' : 4.419,
'Cv0' : 0.525e-5,
'G0' : 0.4,
'chi' : 1.0,
'sgB' : 6.44e-4
}
params = {
'theta' : np.array([0.1]),
'p' : np.array([2.]),
's0' : np.array([0.02]),
'sInf' : np.array([0.01]),
'kappa' : np.array([0.3]),
'theta' : np.array([0.1]),
'p' : np.array([2.]),
's0' : np.array([0.02]),
'sInf' : np.array([0.01]),
'kappa' : np.array([0.3]),
'lgamma' : np.array([-12.]),
'y0' : np.array([0.01]),
'yInf' : np.array([0.003]),
'y1' : np.array([0.09]),
'y2' : np.array([0.7]),
}
'y0' : np.array([0.01]),
'yInf' : np.array([0.003]),
'y1' : np.array([0.09]),
'y2' : np.array([0.7])
}

ptw = physics.MaterialModel(
flow_stress_model=physics.PTW_Yield_Stress, shear_modulus_model=physics.Stein_Shear_Modulus,
)
flow_stress_model = physics.PTW_Yield_Stress,
shear_modulus_model = physics.Stein_Shear_Modulus
)

edot = 2500. * 1e-6 # 2500/s
temp = 1000 # K
emax = 0.6
edot = 2500. * 1e-6 # 2500/s
temp = 1000 # K
emax = 0.6
nhist = 100
sim_strain_histories = physics.generate_strain_history_new(emax=np.array([emax]), edot=np.array([edot]), nhist=nhist)
ptw.initialize(params, consts)
ptw.initialize_state(T = np.array([temp]), stress = np.zeros(1), strain = np.zeros(1))

sim_strain_histories = physics.generate_strain_history_new(
emax = np.array([emax]),
edot = np.array([edot]),
nhist = nhist
)

ptw.initialize(params,consts)

ptw.initialize_state(
T = np.array([temp]),
stress = np.zeros(1),
strain = np.zeros(1)
)

sim_state_histories = ptw.compute_state_history(sim_strain_histories)
sim_strains = sim_state_histories[:,1].T # 2d array: ntot, Nhist
sim_strains = sim_state_histories[:,1].T # 2d array: ntot, Nhist
sim_stresses = sim_state_histories[:,2].T # 2d array: ntot, Nhist

import matplotlib.pyplot as plt
Expand Down

0 comments on commit 510ac96

Please sign in to comment.