Skip to content

Commit

Permalink
module test fixup (idaholab#13260)
Browse files Browse the repository at this point in the history
  • Loading branch information
tophmatthews committed Apr 24, 2019
1 parent a54c047 commit fde8253
Show file tree
Hide file tree
Showing 36 changed files with 1,202 additions and 76 deletions.
8 changes: 4 additions & 4 deletions framework/include/bcs/ADIntegratedBC.h
Expand Up @@ -24,10 +24,10 @@ class ADIntegratedBCTempl : public IntegratedBCBase, public MooseVariableInterfa

virtual MooseVariableFE<T> & variable() override { return _var; }

void computeResidual() override;
void computeJacobian() override;
void computeJacobianBlock(MooseVariableFEBase & jvar) override;
void computeJacobianBlockScalar(unsigned int jvar) override;
virtual void computeResidual() override;
virtual void computeJacobian() override;
virtual void computeJacobianBlock(MooseVariableFEBase & jvar) override;
virtual void computeJacobianBlockScalar(unsigned int jvar) override;

protected:
/**
Expand Down
6 changes: 3 additions & 3 deletions framework/include/bcs/ADNodalBC.h
Expand Up @@ -24,9 +24,9 @@ class ADNodalBCTempl : public NodalBCBase, public MooseVariableInterface<T>

virtual MooseVariableFE<T> & variable() override { return _var; }

void computeResidual() override;
void computeJacobian() override;
void computeOffDiagJacobian(unsigned int jvar) override;
virtual void computeResidual() override;
virtual void computeJacobian() override;
virtual void computeOffDiagJacobian(unsigned int jvar) override;

protected:
/**
Expand Down
2 changes: 1 addition & 1 deletion framework/include/bcs/PresetNodalBC.h
Expand Up @@ -18,7 +18,7 @@ template <>
InputParameters validParams<PresetNodalBC>();

/**
* TODO
* Base class for nodal BCs that (pre)set the solution vector entries.
*/
class PresetNodalBC : public NodalBC
{
Expand Down
2 changes: 1 addition & 1 deletion framework/src/bcs/ADFunctionPresetBC.C
Expand Up @@ -17,7 +17,7 @@ defineADValidParams(
ADPresetNodalBC,
params.addRequiredParam<FunctionName>("function", "The forcing function.");
params.addClassDescription(
"The same as FunctionDirichletBC except the value is applied before the solve begins"););
"The same as ADFunctionDirichletBC except the value is applied before the solve begins"););

template <ComputeStage compute_stage>
ADFunctionPresetBC<compute_stage>::ADFunctionPresetBC(const InputParameters & parameters)
Expand Down
2 changes: 1 addition & 1 deletion framework/src/bcs/ADPresetNodalBC.C
Expand Up @@ -41,4 +41,4 @@ ADPresetNodalBC<compute_stage>::computeQpResidual()
}

// explicit instantiation is required for AD base classes
adBaseClass(ADPresetBC);
adBaseClass(ADPresetNodalBC);
146 changes: 146 additions & 0 deletions modules/combined/test/tests/ad_power_law_creep/power_law_creep.i
@@ -0,0 +1,146 @@
# 1x1x1 unit cube with uniform pressure on top face

[GlobalParams]
displacements = 'disp_x disp_y disp_z'
[]

[Mesh]
type = GeneratedMesh
dim = 3
nx = 1
ny = 1
nz = 1
[]

[Variables]
[./temp]
order = FIRST
family = LAGRANGE
initial_condition = 1000.0
[../]
[]

[Modules/TensorMechanics/Master]
[./all]
strain = FINITE
incremental = true
add_variables = true
generate_output = 'stress_yy creep_strain_xx creep_strain_yy creep_strain_zz elastic_strain_yy'
use_automatic_differentiation = true
[../]
[]

[Functions]
[./top_pull]
type = PiecewiseLinear
x = '0 1'
y = '1 1'
[../]
[]

[Kernels]
[./heat]
type = ADHeatConduction
variable = temp
[../]
[./heat_ie]
type = ADHeatConductionTimeDerivative
variable = temp
[../]
[]

[BCs]
[./u_top_pull]
type = ADPressure
variable = disp_y
component = 1
boundary = top
constant = -10.0e6
function = top_pull
[../]
[./u_bottom_fix]
type = ADPresetBC
variable = disp_y
boundary = bottom
value = 0.0
[../]
[./u_yz_fix]
type = ADPresetBC
variable = disp_x
boundary = left
value = 0.0
[../]
[./u_xy_fix]
type = ADPresetBC
variable = disp_z
boundary = back
value = 0.0
[../]
[./temp_fix]
type = DirichletBC
variable = temp
boundary = 'bottom top'
value = 1000.0
[../]
[]

[Materials]
[./elasticity_tensor]
type = ComputeIsotropicElasticityTensor
youngs_modulus = 2e11
poissons_ratio = 0.3
[../]
[./radial_return_stress]
type = ADComputeMultipleInelasticStress
inelastic_models = 'power_law_creep'
[../]
[./power_law_creep]
type = ADPowerLawCreepStressUpdate
coefficient = 1.0e-15
n_exponent = 4
activation_energy = 3.0e5
temperature = temp
[../]

[./thermal]
type = HeatConductionMaterial
specific_heat = 1.0
thermal_conductivity = 100.
[../]
[./density]
type = ADDensity
density = 1.0
[../]
[]

[Preconditioning]
[./smp]
type = SMP
full = true
[../]
[]

[Executioner]
type = Transient
solve_type = 'PJFNK'

petsc_options = '-snes_ksp'
petsc_options_iname = '-ksp_gmres_restart'
petsc_options_value = '101'

line_search = 'none'

l_max_its = 20
nl_max_its = 20
nl_rel_tol = 1e-6
nl_abs_tol = 1e-6
l_tol = 1e-5
start_time = 0.0
end_time = 1.0
num_steps = 10
dt = 0.1
[]

[Outputs]
exodus = true
[]
@@ -0,0 +1,144 @@
# 1x1x1 unit cube with uniform pressure on top face

[GlobalParams]
displacements = 'disp_x disp_y disp_z'
[]

[Mesh]
type = GeneratedMesh
dim = 3
nx = 1
ny = 1
nz = 1
[]

[Variables]
[./temp]
order = FIRST
family = LAGRANGE
initial_condition = 1000.0
[../]
[]

[Modules/TensorMechanics/Master]
[./all]
strain = FINITE
incremental = true
add_variables = true
generate_output = 'stress_yy creep_strain_xx creep_strain_yy creep_strain_zz elastic_strain_yy'
use_automatic_differentiation = true
[../]
[]

[Functions]
[./top_pull]
type = PiecewiseLinear
x = '0 1'
y = '1 1'
[../]
[]

[Kernels]
[./heat]
type = ADHeatConduction
variable = temp
[../]
[./heat_ie]
type = ADHeatConductionTimeDerivative
variable = temp
[../]
[]

[BCs]
[./u_top_pull]
type = ADPressure
variable = disp_y
component = 1
boundary = top
constant = -10.0e6
function = top_pull
[../]
[./u_bottom_fix]
type = ADPresetBC
variable = disp_y
boundary = bottom
value = 0.0
[../]
[./u_yz_fix]
type = ADPresetBC
variable = disp_x
boundary = left
value = 0.0
[../]
[./u_xy_fix]
type = ADPresetBC
variable = disp_z
boundary = back
value = 0.0
[../]
[./temp_fix]
type = DirichletBC
variable = temp
boundary = 'bottom top'
value = 1000.0
[../]
[]

[Materials]
[./elasticity_tensor]
type = ComputeIsotropicElasticityTensor
youngs_modulus = 2e11
poissons_ratio = 0.3
[../]
[./radial_return_stress]
type = ADComputeMultipleInelasticStress
inelastic_models = 'power_law_creep'
[../]
[./power_law_creep]
type = ADPowerLawCreepStressUpdate
coefficient = 1.0e-15
n_exponent = 4
activation_energy = 3.0e5
temperature = temp
[../]

[./thermal]
type = HeatConductionMaterial
specific_heat = 1.0
thermal_conductivity = 100.
[../]
[./density]
type = ADDensity
density = 1.0
[../]
[]

[Executioner]
type = Transient
solve_type = 'PJFNK'

petsc_options = '-snes_ksp'
petsc_options_iname = '-ksp_gmres_restart'
petsc_options_value = '101'

line_search = 'none'

l_max_its = 20
nl_max_its = 20
nl_rel_tol = 1e-6
nl_abs_tol = 1e-6
l_tol = 1e-5
start_time = 0.0
end_time = 1.0
num_steps = 6
dt = 0.1
[]

[Outputs]
exodus = true
csv = true
[./out]
type = Checkpoint
num_files = 1
[../]
[]

0 comments on commit fde8253

Please sign in to comment.