www.mooseframework.org
CHMath.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
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 "CHMath.h"
11 
12 registerMooseObject("PhaseFieldApp", CHMath);
13 
16 {
18  params.addClassDescription(
19  "Simple demonstration Cahn-Hilliard Kernel using an algebraic double-well potential");
20  return params;
21 }
22 
23 CHMath::CHMath(const InputParameters & parameters) : CHBulk<Real>(parameters) {}
24 
25 RealGradient // Use This an example of the the function should look like
27 {
28  switch (type)
29  {
30  case Residual:
31  return 3 * _u[_qp] * _u[_qp] * _grad_u[_qp] - _grad_u[_qp]; // return Residual value
32 
33  case Jacobian:
34  return 6 * _u[_qp] * _phi[_j][_qp] * _grad_u[_qp] +
35  3 * _u[_qp] * _u[_qp] * _grad_phi[_j][_qp] -
36  _grad_phi[_j][_qp]; // return Jacobian value
37  }
38 
39  mooseError("Invalid type passed in");
40 }
void mooseError(Args &&... args)
This is the Cahn-Hilliard equation base class that implements the bulk or local energy term of the eq...
Definition: CHBulk.h:25
registerMooseObject("PhaseFieldApp", CHMath)
Cahn-Hilliard Kernel implementing the free energy f = 1/4(1-c^2)^2, such that grad df/dc = (3 c^2 -1)...
Definition: CHMath.h:21
virtual RealGradient computeGradDFDCons(PFFunctionType type)
Definition: CHMath.C:26
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
static InputParameters validParams()
Definition: CHMath.C:15
void addClassDescription(const std::string &doc_string)
static InputParameters validParams()
Definition: CHBulk.h:75
CHMath(const InputParameters &parameters)
Definition: CHMath.C:23