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 "SplitCHMath.h" 11 : 12 : registerMooseObject("PhaseFieldApp", SplitCHMath); 13 : 14 : InputParameters 15 79 : SplitCHMath::validParams() 16 : { 17 79 : InputParameters params = SplitCHCRes::validParams(); 18 79 : params.addClassDescription("Simple demonstration split formulation Cahn-Hilliard Kernel using an " 19 : "algebraic double-well potential"); 20 79 : return params; 21 0 : } 22 : 23 42 : SplitCHMath::SplitCHMath(const InputParameters & parameters) : SplitCHCRes(parameters) {} 24 : 25 : Real 26 14184000 : SplitCHMath::computeDFDC(PFFunctionType type) 27 : { 28 14184000 : switch (type) 29 : { 30 7515200 : case Residual: 31 7515200 : return _u[_qp] * _u[_qp] * _u[_qp] - _u[_qp]; // return Residual value 32 : 33 6668800 : case Jacobian: 34 6668800 : return (3.0 * _u[_qp] * _u[_qp] - 1.0) * _phi[_j][_qp]; // return Jacobian value 35 : } 36 : 37 0 : mooseError("Invalid type passed in"); 38 : }