https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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
14
15template <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
26template <bool is_ad>
28 : CompileTimeDerivativesMaterial<1, is_ad, 2>(parameters, {"c"})
29{
30}
31
32template <bool is_ad>
33void
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}
registerMooseObject("PhaseFieldApp", MathCTDFreeEnergy)
T evaluate(Real, const Point &)
static InputParameters validParams()
decltype(CompileTimeDerivativesMaterialInternal::make_tuple_array< GenericVariableValue< is_ad > >(std::make_index_sequence< N >{})) ::type _refs
void addRequiredCoupledVar(const std::string &name, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)
Material class that creates the math free energy with the compile time derivatives framework.
MathCTDFreeEnergyTempl(const InputParameters &parameters)
static InputParameters validParams()