https://mooseframework.inl.gov
MathCTDFreeEnergy.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 
10 #include "MathCTDFreeEnergy.h"
11 
12 registerMooseObject("PhaseFieldApp", MathCTDFreeEnergy);
14 
15 template <bool is_ad>
18 {
20  params.addClassDescription("Material that implements the math free energy using the expression "
21  "builder and automatic differentiation");
22  params.addRequiredCoupledVar("c", "Concentration variable");
23  return params;
24 }
25 
26 template <bool is_ad>
28  : CompileTimeDerivativesMaterial<1, is_ad, 2>(parameters, {"c"})
29 {
30 }
31 
32 template <bool is_ad>
33 void
35 {
36  const auto & [c] = _refs;
37  const auto F = 1.0 / 4.0 * (1.0 + c) * (1.0 + c) * (1.0 - c) * (1.0 - c);
38 
39  evaluate(F);
40 }
MathCTDFreeEnergyTempl(const InputParameters &parameters)
registerMooseObject("PhaseFieldApp", MathCTDFreeEnergy)
static const std::string F
Definition: NS.h:165
void addRequiredCoupledVar(const std::string &name, const std::string &doc_string)
void evaluate(const std::vector< Real > &q_vector, const DenseMatrix< Real > &data, std::vector< Real > &out)
static InputParameters validParams()
void addClassDescription(const std::string &doc_string)
Material class that creates the math free energy with the compile time derivatives framework...
static InputParameters validParams()