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