www.mooseframework.org
TotalFreeEnergyBase.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 "TotalFreeEnergyBase.h"
8 
9 template <>
10 InputParameters
12 {
13  InputParameters params = validParams<AuxKernel>();
14  params.addCoupledVar("interfacial_vars", "Variable names that contribute to interfacial energy");
15  params.addCoupledVar(
16  "additional_free_energy",
17  0.0,
18  "Coupled variable holding additional free energy contributions to be summed up");
19  return params;
20 }
21 
22 TotalFreeEnergyBase::TotalFreeEnergyBase(const InputParameters & parameters)
23  : AuxKernel(parameters),
24  _nvars(coupledComponents("interfacial_vars")),
25  _vars(_nvars),
26  _grad_vars(_nvars),
27  _kappa_names(getParam<std::vector<MaterialPropertyName>>("kappa_names")),
28  _nkappas(_kappa_names.size()),
29  _additional_free_energy(coupledValue("additional_free_energy"))
30 {
31  // Fetch coupled variables and their gradients
32  for (unsigned int i = 0; i < _nvars; ++i)
33  {
34  _vars[i] = &coupledValue("interfacial_vars", i);
35  _grad_vars[i] = &coupledGradient("interfacial_vars", i);
36  }
37 }
unsigned int _nvars
Coupled interface variables.
InputParameters validParams< TotalFreeEnergyBase >()
TotalFreeEnergyBase(const InputParameters &parameters)
std::vector< const VariableGradient * > _grad_vars
std::vector< const VariableValue * > _vars