www.mooseframework.org
CHMath.C
Go to the documentation of this file.
1 /****************************************************************/
2 /* MOOSE - Multiphysics Object Oriented Simulation Environment */
3 /* */
4 /* All contents are licensed under LGPL V2.1 */
5 /* See LICENSE for full restrictions */
6 /****************************************************************/
7 #include "CHMath.h"
8 
9 template <>
10 InputParameters
12 {
13  InputParameters params = CHBulk<Real>::validParams();
14  params.addClassDescription(
15  "Simple demonstration Cahn-Hilliard Kernel using an algebraic double-well potential");
16  return params;
17 }
18 
19 CHMath::CHMath(const InputParameters & parameters) : CHBulk<Real>(parameters) {}
20 
21 RealGradient // Use This an example of the the function should look like
23 {
24  switch (type)
25  {
26  case Residual:
27  return 3 * _u[_qp] * _u[_qp] * _grad_u[_qp] - _grad_u[_qp]; // return Residual value
28 
29  case Jacobian:
30  return 6 * _u[_qp] * _phi[_j][_qp] * _grad_u[_qp] +
31  3 * _u[_qp] * _u[_qp] * _grad_phi[_j][_qp] -
32  _grad_phi[_j][_qp]; // return Jacobian value
33  }
34 
35  mooseError("Invalid type passed in");
36 }
InputParameters validParams< CHMath >()
Definition: CHMath.C:11
This is the Cahn-Hilliard equation base class that implements the bulk or local energy term of the eq...
Definition: CHBulk.h:23
virtual RealGradient computeGradDFDCons(PFFunctionType type)
Definition: CHMath.C:22
static InputParameters validParams()
Definition: CHBulk.h:73
CHMath(const InputParameters &parameters)
Definition: CHMath.C:19