Line data Source code
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 : 10 : #include "DoubleWellPotential.h" 11 : 12 : InputParameters 13 0 : DoubleWellPotential::validParams() 14 : { 15 0 : InputParameters params = KernelValue::validParams(); 16 0 : params.addClassDescription( 17 : "Simple demonstration Allen-Cahn Kernel using an algebraic double-well potential"); 18 0 : params.addParam<MaterialPropertyName>("mob_name", "L", "The mobility used with the kernel"); 19 : 20 0 : return params; 21 0 : } 22 : 23 0 : DoubleWellPotential::DoubleWellPotential(const InputParameters & parameters) 24 0 : : ACBulk<Real>(parameters) 25 : { 26 0 : } 27 : 28 : Real 29 0 : DoubleWellPotential::computeDFDOP(PFFunctionType type) 30 : { 31 0 : switch (type) 32 : { 33 0 : case Residual: 34 0 : return _u[_qp] * _u[_qp] * _u[_qp] - _u[_qp]; 35 : 36 0 : case Jacobian: 37 0 : return _phi[_j][_qp] * (3.0 * _u[_qp] * _u[_qp] - 1.0); 38 : } 39 : 40 0 : mooseError("Invalid type passed in"); 41 : }