Skip to content

Commit

Permalink
Edit documentation and address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
dewenyushu committed Jun 19, 2023
1 parent 938e055 commit 29a5307
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 12 deletions.
4 changes: 2 additions & 2 deletions doc/content/source/userobjects/BatchStressGrad.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

## Description

This `UserObject` computes double contraction of the elastic tensor derivative and the forward mechanical strain, i.e.,
This `UserObject` computes double contraction of the elasticity tensor derivative and the forward mechanical strain, i.e.,
\begin{equation}
\underbrace{\frac{\partial \boldsymbol{C}}{\partial p}}_{\text{elastic tensor derivative}} \underbrace{(\boldsymbol{L} u)}_{\text{forward strain}}
\underbrace{\frac{\partial \boldsymbol{C}}{\partial p}}_{\text{elasticity tensor derivative}} \underbrace{(\boldsymbol{L} u)}_{\text{forward strain}}
\end{equation}
as a batch material.
Here, $\boldsymbol{C}$ is the elasticity tensor, $p$ is the interested parameter, $\boldsymbol{L}$ is the symmetric strain operator for the elasticity problem, and $\boldsymbol{L} u$ is the strain from the forward problem. This object requires the elasticity tensor derivative material property (i.e., $\frac{\partial \boldsymbol{C}}{\partial p}$) as its input.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,21 @@

## Description

This `VectorPostprocessor` computes the gradient of objective function with respect to interested parameter for elastic problem. Specifically,
This `VectorPostprocessor` is utilized in a mechanical inverse optimization problem (see [Inverse Optimization Theory](/InvOptTheory.md)) for computing the gradient of objective function with respect to a parameter of interest.

Specifically, the objective function is defined as the sum of the regularization and the displacement mismatch (between the simulation and the measurement data at specific locations) as follows:
\begin{equation}
F({u}, \boldsymbol{p}) = ||\boldsymbol{S}{u} - \boldsymbol{u}_m ||^2 + R({u}, \boldsymbol{p}),
\end{equation}
where ${u}$ denotes the displacement from the forward problem, $\boldsymbol{S}$ is the sampling operator, $\boldsymbol{u}_m$ are the measurements, $\boldsymbol{p} = [p_1, p_2, ..., p_n]$ is the vector of parameters, and $R$ is the regularization term.

The gradient of objective function with respect to one scalar parameter ($p_i$) is
\begin{equation}
\frac{\text{d}\boldsymbol{F}}{\text{d}p} = - \int \underbrace{(\boldsymbol{L}\lambda)^T}_{\text{adjoint strain}} \underbrace{\frac{\partial \boldsymbol{C}}{\partial p} (\boldsymbol{L} u)}_{\text{stress gradient}} \text{d}\Omega,
\frac{\text{d}{F}}{\text{d}p_i} = - \int \underbrace{(\boldsymbol{L}\lambda)^T}_{\text{adjoint strain}} \underbrace{\frac{\partial \boldsymbol{C}}{\partial p_i} (\boldsymbol{L} u)}_{\text{gradient of stress}} \text{d}\Omega,
\end{equation}
where $\boldsymbol{F}$ is the objective function, $\boldsymbol{L}$ is the differential operator for the elasticity problem, $\lambda$ is the adjoint displacement, $\boldsymbol{C}$ is the elastic tensor, $p$ is the interested parameter, and $u$ is displacement from the forward problem.
where ${F}$ is the objective function, $\boldsymbol{L}$ is the symmetric strain operator for the elasticity problem, $\lambda$ is the adjoint displacement, $\boldsymbol{C}$ is the elasticity tensor, and $p_i$ is the interested scalar parameter.

Specifically, this object takes the `adjoint strain` and the `stress gradient` as inputs, computes the double contraction of the two inputs, and integrate over the entire domain. Specifically, the `adjoint strain` is the strain from the adjoint problem, the `stress gradient` should be a batch material (e.g., [BatchStressGrad](/BatchStressGrad.md)).
Specifically, this object takes the `adjoint strain` and the `gradient of stress w.r.t. parameter` as inputs, computes the double contraction of the two inputs, and integrate over the entire domain. Specifically, the `adjoint strain` is the strain from the adjoint problem, the `gradient of stress w.r.t. parameter` should be a batch material (e.g., [BatchStressGrad](/BatchStressGrad.md)).

## Example Input File Syntax

Expand Down
12 changes: 9 additions & 3 deletions src/userobjects/BatchStressGrad.C
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,25 @@ BatchStressGrad::validParams()
{
auto params = BatchStressGradParent::validParams();
params.addRequiredParam<MaterialPropertyName>(
"elastic_tensor_derivative", "Name of the elastic tensor derivative material property.");
"elasticity_tensor_derivative",
"Name of the elasticity tensor derivative material property.");
return params;
}

BatchStressGrad::BatchStressGrad(const InputParameters & params)
: BatchStressGradParent(params,
// here we pass the derivative of elastic tensor wrt to the parameter
"elastic_tensor_derivative",
// here we pass the derivative of elasticity tensor wrt to the parameter
"elasticity_tensor_derivative",
// here we pass in the forward strain
"forward_mechanical_strain")
{
}

/*
Note: The following calculation is currently specialized for a linear elastic inverse optimization
problem. This will be swapped out later on when we can get the gradient of stress w.r.t. the
interested parameter from NEML for general material models.
*/
void
BatchStressGrad::batchCompute()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ AdjointStrainStressGradInnerProduct::validParams()
params.addRequiredParam<MaterialPropertyName>(
"adjoint_strain_name", "Name of the strain property in the adjoint problem");

params.addClassDescription("Compute the gradient for elastic material inversion");
params.addClassDescription(
"Compute the parameter gradient for linear elastic material inversion");
return params;
}
AdjointStrainStressGradInnerProduct::AdjointStrainStressGradInnerProduct(
Expand Down
4 changes: 2 additions & 2 deletions test/tests/bimaterial_elastic_inversion_batch_mat/grad.i
Original file line number Diff line number Diff line change
Expand Up @@ -162,12 +162,12 @@
[UserObjects]
[stress_grad_lambda]
type = BatchStressGrad
elastic_tensor_derivative = 'dC_dlambda_elasticity_tensor' # calculated in dC_dlambda
elasticity_tensor_derivative = 'dC_dlambda_elasticity_tensor' # calculated in dC_dlambda
execution_order_group = -1 # need to make sure that the UO executes before the VPP
[]
[stress_grad_mu]
type = BatchStressGrad
elastic_tensor_derivative = 'dC_dmu_elasticity_tensor' # calculated in dC_dmu
elasticity_tensor_derivative = 'dC_dmu_elasticity_tensor' # calculated in dC_dmu
execution_order_group = -1 # need to make sure that the UO executes before the VPP
[]
[]
Expand Down

0 comments on commit 29a5307

Please sign in to comment.