https://mooseframework.inl.gov
Loading...
Searching...
No Matches
AllenCahnElasticEnergyOffDiag.C
Go to the documentation of this file.
1//* This file is part of the MOOSE framework
2//* https://mooseframework.inl.gov
3//*
4//* All rights reserved, see COPYRIGHT for full restrictions
5//* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6//*
7//* Licensed under LGPL 2.1, please see LICENSE for details
8//* https://www.gnu.org/licenses/lgpl-2.1.html
9
11#include "MathUtils.h"
12#include "RankTwoTensor.h"
13
15
18{
20 params.addClassDescription("This kernel calculates off-diagonal Jacobian of elastic energy in "
21 "AllenCahn with respect to displacements");
22 params.addCoupledVar("displacements",
23 "The vector of displacements suitable for the problem statement");
24 params.addParam<MaterialPropertyName>(
25 "F_name", "E_el", "Name of material property storing the elastic energy");
26 params.addParam<MaterialPropertyName>("mob_name", "L", "The mobility used with the kernel");
27 return params;
28}
29
32 _L(getMaterialProperty<Real>("mob_name")),
33 _disp_map(getParameterJvarMap("displacements")),
34 _d2Fdcdstrain(getMaterialProperty<RankTwoTensor>("d2Fdcdstrain"))
35{
36}
37
38Real
40{
41 auto dispvar = mapJvarToCvar(jvar, _disp_map);
42 if (dispvar >= 0)
43 {
44 const Real dxddFdc = _L[_qp] * _test[_i][_qp];
45 const Real d2Fdcdstrain_comp =
46 (_d2Fdcdstrain[_qp].column(dispvar) + _d2Fdcdstrain[_qp].row(dispvar)) / 2.0 *
47 _grad_phi[_j][_qp];
48 return dxddFdc * d2Fdcdstrain_comp;
49 }
50
51 return 0.0;
52}
registerMooseObject("PhaseFieldApp", AllenCahnElasticEnergyOffDiag)
This kernel computes the off-diagonal jacobian of elastic energy in AllenCahn respect to displacement...
JvarMap _disp_map
Displacement variables used for off-diagonal Jacobian.
const MaterialProperty< Real > & _L
Mobility.
const MaterialProperty< RankTwoTensor > & _d2Fdcdstrain
Free energy material properties and derivatives.
AllenCahnElasticEnergyOffDiag(const InputParameters &parameters)
virtual Real computeQpOffDiagJacobian(unsigned int jvar) override
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)
void addCoupledVar(const std::string &name, const std::string &doc_string)
static InputParameters validParams()