optimism.phasefield package
Subpackages
- optimism.phasefield.test package
- Submodules
- optimism.phasefield.test.plotPhaseFieldThresholdModel module
- optimism.phasefield.test.plotSandiaModelUniaxial module
- optimism.phasefield.test.test_PhaseFieldLorentzPlastic module
GradOfPlasticPhaseFieldModelFixture
GradOfPlasticPhaseFieldModelFixture._classSetupFailed
GradOfPlasticPhaseFieldModelFixture._class_cleanups
GradOfPlasticPhaseFieldModelFixture.setUp()
GradOfPlasticPhaseFieldModelFixture.test_elastic_energy()
GradOfPlasticPhaseFieldModelFixture.test_plastic_stress()
GradOfPlasticPhaseFieldModelFixture.test_rotation_invariance()
GradOfPlasticPhaseFieldModelFixture.test_zero_point()
- optimism.phasefield.test.test_PhaseFieldLorentzPlasticPatch module
TestSingleMeshFixture
TestSingleMeshFixture._classSetupFailed
TestSingleMeshFixture._class_cleanups
TestSingleMeshFixture.no_test_uniaxial()
TestSingleMeshFixture.setUp()
TestSingleMeshFixture.test_constrained_hessian()
TestSingleMeshFixture.test_patch_test()
TestSingleMeshFixture.test_sparse_hessian_at_nonzero_phase()
TestSingleMeshFixture.test_sparse_hessian_at_zero_phase()
- optimism.phasefield.test.test_PhaseFieldThreshold module
PhaseFieldThresholdModelFixture
PhaseFieldThresholdModelFixture._classSetupFailed
PhaseFieldThresholdModelFixture._class_cleanups
PhaseFieldThresholdModelFixture.setUp()
PhaseFieldThresholdModelFixture.test_rotation_invariance()
PhaseFieldThresholdModelFixture.test_uniaxial_energy()
PhaseFieldThresholdModelFixture.test_zero_point()
- optimism.phasefield.test.test_PhaseFieldThresholdPatch module
TestSingleMeshFixture
TestSingleMeshFixture._classSetupFailed
TestSingleMeshFixture._class_cleanups
TestSingleMeshFixture.setUp()
TestSingleMeshFixture.test_constrained_hessian()
TestSingleMeshFixture.test_patch_test()
TestSingleMeshFixture.test_sparse_hessian_at_nonzero_phase()
TestSingleMeshFixture.test_sparse_hessian_at_zero_phase()
- optimism.phasefield.test.test_PhaseFieldThresholdPlastic module
GradOfPlasticPhaseFieldModelFixture
GradOfPlasticPhaseFieldModelFixture._classSetupFailed
GradOfPlasticPhaseFieldModelFixture._class_cleanups
GradOfPlasticPhaseFieldModelFixture.no_test_plastic_strain_path()
GradOfPlasticPhaseFieldModelFixture.setUp()
GradOfPlasticPhaseFieldModelFixture.test_elastic_energy()
GradOfPlasticPhaseFieldModelFixture.test_plastic_stress()
GradOfPlasticPhaseFieldModelFixture.test_rotation_invariance()
GradOfPlasticPhaseFieldModelFixture.test_zero_point()
- optimism.phasefield.test.test_PhaseFieldUniaxial module
- Module contents
Submodules
optimism.phasefield.MaterialPointSimulator module
- class optimism.phasefield.MaterialPointSimulator.MaterialPointSimulator(materialModel, maxStrain, strainRate, steps=10)[source]
Bases:
object
Generates the uniaxial response of a given phase field potential density function
The non-axial strain components are determined by minimizing the potential, which coincides with stress-free conditions for every stress component besides the uniaxial stress.
- run():
Launches the simluation with the given parameters
- class optimism.phasefield.MaterialPointSimulator.UniaxialOutput(times, strainHistory, stressHistory, kirchhoffStressHistory, energyHistory, internalVariableHistory, phaseHistory)
Bases:
tuple
- _asdict()
Return a new dict which maps field names to their values.
- _field_defaults = {}
- _fields = ('times', 'strainHistory', 'stressHistory', 'kirchhoffStressHistory', 'energyHistory', 'internalVariableHistory', 'phaseHistory')
- classmethod _make(iterable)
Make a new UniaxialOutput object from a sequence or iterable
- _replace(**kwds)
Return a new UniaxialOutput object replacing specified fields with new values
- energyHistory
Alias for field number 4
- internalVariableHistory
Alias for field number 5
- kirchhoffStressHistory
Alias for field number 3
- phaseHistory
Alias for field number 6
- strainHistory
Alias for field number 1
- stressHistory
Alias for field number 2
- times
Alias for field number 0
optimism.phasefield.PhaseField module
- class optimism.phasefield.PhaseField.PhaseFieldFunctions(compute_internal_energy, compute_output_energy_densities_and_fluxes, compute_strain_energy_densities, compute_phase_potential_energy, compute_element_stiffnesses, compute_block_diagonal_element_stiffnesses, compute_initial_state, compute_updated_internal_variables, compute_constraint_hessian)
Bases:
tuple
- _asdict()
Return a new dict which maps field names to their values.
- _field_defaults = {}
- _fields = ('compute_internal_energy', 'compute_output_energy_densities_and_fluxes', 'compute_strain_energy_densities', 'compute_phase_potential_energy', 'compute_element_stiffnesses', 'compute_block_diagonal_element_stiffnesses', 'compute_initial_state', 'compute_updated_internal_variables', 'compute_constraint_hessian')
- classmethod _make(iterable)
Make a new PhaseFieldFunctions object from a sequence or iterable
- _replace(**kwds)
Return a new PhaseFieldFunctions object replacing specified fields with new values
- compute_block_diagonal_element_stiffnesses
Alias for field number 5
- compute_constraint_hessian
Alias for field number 8
- compute_element_stiffnesses
Alias for field number 4
- compute_initial_state
Alias for field number 6
- compute_internal_energy
Alias for field number 0
- compute_output_energy_densities_and_fluxes
Alias for field number 1
- compute_phase_potential_energy
Alias for field number 3
- compute_strain_energy_densities
Alias for field number 2
- compute_updated_internal_variables
Alias for field number 7
- optimism.phasefield.PhaseField._compute_block_diagonal_element_stiffnesses(U, internalVariables, dt, functionSpace, lagrangian_density, modify_element_gradient)[source]
- optimism.phasefield.PhaseField._compute_element_stiffnesses(U, internalVariables, dt, functionSpace, lagrangian_density, modify_element_gradient)[source]
- optimism.phasefield.PhaseField.axisymmetric_element_gradient_transformation(elemGrads, elemShapes, elemVols, elemNodalDofs, elemNodalCoords)[source]
- optimism.phasefield.PhaseField.compute_element_stiffness_from_global_fields(U, coords, elemInternals, dt, elemConns, elemShapes, elemShapeGrads, elemVols, lagrangian_density, modify_element_gradient)[source]
- optimism.phasefield.PhaseField.compute_phase_field_constraint_hessian(Lambda, kappa, constraint, dofManager)[source]
Augmented Lagrange Hessian terms for lower bound constrained phase field models.
Because this is a simple bound constraint, the Hessian terms are diagonal. This function returns just this diagonal, which can be added onto the unconstrained Hessian matrix.
Note that return value is a standard numpy array (with one axis). This is so that it can be added to a sparse matrix without causing an error. Jax numpy arrays do not work with scipy sparse arrays.
- Parameters:
Lambda (array of constraint forces)
kappa (array of penalty parameters)
constraint (values of lower bound constraint functions) – (just unknown nodal phases)
dofManager (dofManager object for current mesh)
- Returns:
d – part of the AL Hessian
- Return type:
standard numpy array with one axis representing the constraint
- optimism.phasefield.PhaseField.create_phasefield_functions(functionSpace, mode2D, materialModel, pressureProjectionDegree=None)[source]
optimism.phasefield.PhaseFieldClassic module
optimism.phasefield.PhaseFieldLorentzPlastic module
- optimism.phasefield.PhaseFieldLorentzPlastic._compute_elastic_linear_strain(dispGrad, state)[source]
- optimism.phasefield.PhaseFieldLorentzPlastic._compute_elastic_logarithmic_strain(dispGrad, state)[source]
- optimism.phasefield.PhaseFieldLorentzPlastic.compute_elastic_linear_strain(dispGrad, plasticStrain)[source]
- optimism.phasefield.PhaseFieldLorentzPlastic.compute_elastic_logarithmic_strain(dispGrad, Fp)[source]
- optimism.phasefield.PhaseFieldLorentzPlastic.compute_free_energy_density(elasticStrain, phase, phaseGrad, eqps, eqpsOld, dt, props, hardeningModel)[source]
- optimism.phasefield.PhaseFieldLorentzPlastic.compute_state_increment(elasticTrialStrain, phase, stateOld, dt, props, hardeningModel)[source]
- optimism.phasefield.PhaseFieldLorentzPlastic.compute_state_new_finite_deformations(dispGrad, phase, phaseGrad, stateOld, dt, props, hardeningModel)[source]
- optimism.phasefield.PhaseFieldLorentzPlastic.compute_state_new_small_deformations(dispGrad, phase, phaseGrad, stateOld, dt, props, hardeningModel)[source]
- optimism.phasefield.PhaseFieldLorentzPlastic.create_material_model_functions(properties)[source]
- properties:
‘elastic modulus’ ‘poisson ratio’ ‘critical energy release rate’ ‘critical strain energy density’ ‘regularization length’ ‘yield strength’ ‘hardening modulus’
- optimism.phasefield.PhaseFieldLorentzPlastic.dr(elasticTrialStrain, eqps, eqpsOld, phase, dt, props, hardeningModel)
Jacobian of incremental_potential with respect to positional argument(s) (0, 1, 3). Takes the same arguments as incremental_potential but returns the jacobian of the output with respect to the arguments at positions (0, 1, 3).
- optimism.phasefield.PhaseFieldLorentzPlastic.elastic_deviatoric_free_energy(elasticStrain, phase, props)[source]
- optimism.phasefield.PhaseFieldLorentzPlastic.elastic_volumetric_free_energy(strain, phase, props)[source]
- optimism.phasefield.PhaseFieldLorentzPlastic.energy_density_generic(elStrain, phase, phaseGrad, state, dt, props, hardeningModel, doUpdate)[source]
- optimism.phasefield.PhaseFieldLorentzPlastic.incremental_potential(elasticTrialStrain, eqps, eqpsOld, phase, dt, props, hardeningModel)[source]
- optimism.phasefield.PhaseFieldLorentzPlastic.make_initial_state_finite_deformations(shape=(1,))[source]
- optimism.phasefield.PhaseFieldLorentzPlastic.make_initial_state_small_deformations(shape=(1,))[source]
- optimism.phasefield.PhaseFieldLorentzPlastic.phase_potential_density(phase, gradPhase, props)[source]
- optimism.phasefield.PhaseFieldLorentzPlastic.r(elasticTrialStrain, eqps, eqpsOld, phase, dt, props, hardeningModel)
Jacobian of incremental_potential with respect to positional argument(s) 1. Takes the same arguments as incremental_potential but returns the jacobian of the output with respect to the arguments at positions 1.
- optimism.phasefield.PhaseFieldLorentzPlastic.r_and_deqps(elasticTrialStrain, eqps, eqpsOld, phase, dt, props, hardeningModel)
Value and gradient of incremental_potential with respect to positional argument(s) 1. Takes the same arguments as incremental_potential but returns a two-element tuple where the first element is the value of incremental_potential and the second element is the gradient, which has the same shape as the arguments at positions 1.
optimism.phasefield.PhaseFieldMaterialModel module
- class optimism.phasefield.PhaseFieldMaterialModel.MaterialModel(compute_energy_density, compute_output_energy_density, compute_strain_energy_density, compute_phase_potential_density, compute_initial_state, compute_state_new)
Bases:
tuple
- _asdict()
Return a new dict which maps field names to their values.
- _field_defaults = {}
- _fields = ('compute_energy_density', 'compute_output_energy_density', 'compute_strain_energy_density', 'compute_phase_potential_density', 'compute_initial_state', 'compute_state_new')
- classmethod _make(iterable)
Make a new MaterialModel object from a sequence or iterable
- _replace(**kwds)
Return a new MaterialModel object replacing specified fields with new values
- compute_energy_density
Alias for field number 0
- compute_initial_state
Alias for field number 4
- compute_output_energy_density
Alias for field number 1
- compute_phase_potential_density
Alias for field number 3
- compute_state_new
Alias for field number 5
- compute_strain_energy_density
Alias for field number 2
optimism.phasefield.PhaseFieldThreshold module
- class optimism.phasefield.PhaseFieldThreshold.Properties(E, nu, mu, kappa, Gc, l)
Bases:
tuple
- E
Alias for field number 0
- Gc
Alias for field number 4
- _asdict()
Return a new dict which maps field names to their values.
- _field_defaults = {}
- _fields = ('E', 'nu', 'mu', 'kappa', 'Gc', 'l')
- classmethod _make(iterable)
Make a new Properties object from a sequence or iterable
- _replace(**kwds)
Return a new Properties object replacing specified fields with new values
- kappa
Alias for field number 3
- l
Alias for field number 5
- mu
Alias for field number 2
- nu
Alias for field number 1
- optimism.phasefield.PhaseFieldThreshold.create_material_model_functions(properties)[source]
- properties:
‘elastic modulus’: real ‘poisson ratio’: real ‘critical energy release rate’: real ‘regularization length’: real ‘kinematics’: string
Value ‘large deformations’ or ‘small deformations’
- optimism.phasefield.PhaseFieldThreshold.elastic_deviatoric_free_energy(strain, phase, props)[source]
optimism.phasefield.PhaseFieldThresholdPlastic module
- class optimism.phasefield.PhaseFieldThresholdPlastic.Properties(E, nu, mu, kappa, Gc, l, Y0, H)
Bases:
tuple
- E
Alias for field number 0
- Gc
Alias for field number 4
- H
Alias for field number 7
- Y0
Alias for field number 6
- _asdict()
Return a new dict which maps field names to their values.
- _field_defaults = {}
- _fields = ('E', 'nu', 'mu', 'kappa', 'Gc', 'l', 'Y0', 'H')
- classmethod _make(iterable)
Make a new Properties object from a sequence or iterable
- _replace(**kwds)
Return a new Properties object replacing specified fields with new values
- kappa
Alias for field number 3
- l
Alias for field number 5
- mu
Alias for field number 2
- nu
Alias for field number 1
- optimism.phasefield.PhaseFieldThresholdPlastic.compute_element_energy(compute_free_energy_density, U, state, shapeGrad, conn)[source]
- optimism.phasefield.PhaseFieldThresholdPlastic.compute_state_increment(elasticTrialStrain, phase, stateOld, props)[source]
- optimism.phasefield.PhaseFieldThresholdPlastic.compute_state_new(dispGrad, phase, phaseGrad, stateOld, props)[source]
- optimism.phasefield.PhaseFieldThresholdPlastic.compute_total_energy(compute_free_energy_density, U, states, mesh)[source]
- optimism.phasefield.PhaseFieldThresholdPlastic.dr(elasticTrialStrain, eqps, eqpsOld, phase, props)
Jacobian of incremental_potential with respect to positional argument(s) (0, 1, 3). Takes the same arguments as incremental_potential but returns the jacobian of the output with respect to the arguments at positions (0, 1, 3).
- optimism.phasefield.PhaseFieldThresholdPlastic.dr_dstrain_and_deqps(elasticTrialStrain, eqps, eqpsOld, phase, props)
Jacobian of incremental_potential with respect to positional argument(s) (0, 1). Takes the same arguments as incremental_potential but returns the jacobian of the output with respect to the arguments at positions (0, 1).
- optimism.phasefield.PhaseFieldThresholdPlastic.elastic_deviatoric_free_energy(elasticStrain, phase, props)[source]
- optimism.phasefield.PhaseFieldThresholdPlastic.elastic_volumetric_free_energy(strain, phase, props)[source]
- optimism.phasefield.PhaseFieldThresholdPlastic.energy_density(dispGrad, phase, phaseGrad, state, props, doUpdate=True)[source]
- optimism.phasefield.PhaseFieldThresholdPlastic.energy_density_generic(elStrain, phase, phaseGrad, state, props, doUpdate)[source]
- optimism.phasefield.PhaseFieldThresholdPlastic.flow_stress(eqps, props)
Jacobian of hardening_energy_density with respect to positional argument(s) 0. Takes the same arguments as hardening_energy_density but returns the jacobian of the output with respect to the arguments at positions 0.
- optimism.phasefield.PhaseFieldThresholdPlastic.incremental_potential(elasticTrialStrain, eqps, eqpsOld, phase, props)[source]
- optimism.phasefield.PhaseFieldThresholdPlastic.interpolate_element_kinematics(U, shapeGrad, conn)[source]
- optimism.phasefield.PhaseFieldThresholdPlastic.phase_potential_density(phase, gradPhase, props)[source]
- optimism.phasefield.PhaseFieldThresholdPlastic.r(elasticTrialStrain, eqps, eqpsOld, phase, props)
Jacobian of incremental_potential with respect to positional argument(s) 1. Takes the same arguments as incremental_potential but returns the jacobian of the output with respect to the arguments at positions 1.
- optimism.phasefield.PhaseFieldThresholdPlastic.r_and_deqps(elasticTrialStrain, eqps, eqpsOld, phase, props)
Value and gradient of incremental_potential with respect to positional argument(s) 1. Takes the same arguments as incremental_potential but returns a two-element tuple where the first element is the value of incremental_potential and the second element is the gradient, which has the same shape as the arguments at positions 1.