本文整理汇总了C++中MooseVariable::name方法的典型用法代码示例。如果您正苦于以下问题:C++ MooseVariable::name方法的具体用法?C++ MooseVariable::name怎么用?C++ MooseVariable::name使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MooseVariable
的用法示例。
在下文中一共展示了MooseVariable::name方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: name
KKSPhaseChemicalPotential::KKSPhaseChemicalPotential(const InputParameters & parameters)
: DerivativeMaterialInterface<JvarMapKernelInterface<Kernel>>(parameters),
_cb_var(coupled("cb")),
_cb_name(getVar("cb", 0)->name()),
// first derivatives
_dfadca(getMaterialPropertyDerivative<Real>("fa_name", _var.name())),
_dfbdcb(getMaterialPropertyDerivative<Real>("fb_name", _cb_name)),
// second derivatives d2F/dx*dca for jacobian diagonal elements
_d2fadca2(getMaterialPropertyDerivative<Real>("fa_name", _var.name(), _var.name())),
_d2fbdcbca(getMaterialPropertyDerivative<Real>("fb_name", _cb_name, _var.name()))
{
MooseVariable * arg;
unsigned int i;
#ifdef DEBUG
_console << "KKSPhaseChemicalPotential(" << name() << ") " << _var.name() << ' ' << _cb_name
<< '\n';
#endif
unsigned int nvar = _coupled_moose_vars.size();
_d2fadcadarg.resize(nvar);
_d2fbdcbdarg.resize(nvar);
for (i = 0; i < nvar; ++i)
{
// get the moose variable
arg = _coupled_moose_vars[i];
// lookup table for the material properties representing the derivatives needed for the
// off-diagonal jacobian
_d2fadcadarg[i] = &getMaterialPropertyDerivative<Real>("fa_name", _var.name(), arg->name());
_d2fbdcbdarg[i] = &getMaterialPropertyDerivative<Real>("fb_name", _cb_name, arg->name());
}
}
示例2: KKSACBulkBase
KKSACBulkC::KKSACBulkC(const InputParameters & parameters) :
KKSACBulkBase(parameters),
_ca_name(getVar("ca", 0)->name()),
_ca_var(coupled("ca")),
_ca(coupledValue("ca")),
_cb_name(getVar("cb", 0)->name()),
_cb_var(coupled("cb")),
_cb(coupledValue("cb")),
_prop_h(getMaterialProperty<Real>("h")),
_prop_dFadca(getMaterialPropertyDerivative<Real>("fa_name", _ca_name)),
_prop_d2Fadca2(getMaterialPropertyDerivative<Real>("fa_name", _ca_name, _ca_name)),
_prop_d2Fbdcb2(getMaterialPropertyDerivative<Real>("fb_name", _cb_name, _cb_name))
{
//Resize to number of coupled variables (_nvar from KKSACBulkBase constructor)
_prop_d2Fadcadarg.resize(_nvar);
// Iterate over all coupled variables
for (unsigned int i = 0; i < _nvar; ++i)
{
MooseVariable *cvar = _coupled_moose_vars[i];
// get second partial derivatives wrt ca and other coupled variable
_prop_d2Fadcadarg[i] = &getMaterialPropertyDerivative<Real>("fa_name", _ca_name, cvar->name());
}
}
示例3:
KKSSplitCHCRes::KKSSplitCHCRes(const InputParameters & parameters) :
DerivativeMaterialInterface<JvarMapKernelInterface<SplitCHBase> >(parameters),
// number of coupled variables (ca, args_a[])
_nvar(_coupled_moose_vars.size()),
_ca_var(coupled("ca")),
_ca_name(getVar("ca", 0)->name()),
_cb_var(coupled("cb")),
_cb_name(getVar("cb", 0)->name()),
_prop_h(getMaterialProperty<Real>("h_name")),
_first_derivative_Fa(getMaterialPropertyDerivative<Real>("fa_name", _ca_name)),
_second_derivative_Fa(getMaterialPropertyDerivative<Real>("fa_name", _ca_name, _ca_name)),
_second_derivative_Fb(getMaterialPropertyDerivative<Real>("fb_name", _cb_name, _cb_name)),
_w_var(coupled("w")),
_w(coupledValue("w"))
{
// reserve space for derivatives
_d2Fadcadarg.resize(_nvar);
// Iterate over all coupled variables
for (unsigned int i = 0; i < _nvar; ++i)
{
MooseVariable *cvar = this->_coupled_moose_vars[i];
// get the second derivative material property
_d2Fadcadarg[i] = &getMaterialPropertyDerivative<Real>("fa_name", _ca_name, cvar->name());
}
}
示例4:
KKSACBulkBase::KKSACBulkBase(const InputParameters & parameters) :
ACBulk<Real>(parameters),
// number of coupled variables (ca, args_a[])
_nvar(_coupled_moose_vars.size()),
_eta_name(_var.name()),
_prop_Fa(getMaterialProperty<Real>("fa_name")),
_prop_Fb(getMaterialProperty<Real>("fb_name")),
_prop_dFa(getMaterialPropertyDerivative<Real>("fa_name", _eta_name)),
_prop_dFb(getMaterialPropertyDerivative<Real>("fb_name", _eta_name)),
_prop_dh(getMaterialPropertyDerivative<Real>("h_name", _eta_name)),
_prop_d2h(getMaterialPropertyDerivative<Real>("h_name", _eta_name, _eta_name))
{
// reserve space for derivatives
_derivatives_Fa.resize(_nvar);
_derivatives_Fb.resize(_nvar);
_grad_args.resize(_nvar);
// Iterate over all coupled variables
for (unsigned int i = 0; i < _nvar; ++i)
{
MooseVariable *cvar = _coupled_moose_vars[i];
// get the first derivatives of Fa and Fb material property
_derivatives_Fa[i] = &getMaterialPropertyDerivative<Real>("fa_name", cvar->name());
_derivatives_Fb[i] = &getMaterialPropertyDerivative<Real>("fb_name", cvar->name());
// get the gradient
_grad_args[i] = &(cvar->gradSln());
}
}
示例5:
KKSCHBulk::KKSCHBulk(const InputParameters & parameters)
: CHBulk<Real>(parameters),
// number of coupled variables (ca, args_a[])
_nvar(_coupled_moose_vars.size()),
_ca_var(coupled("ca")),
_ca_name(getVar("ca", 0)->name()),
_cb_var(coupled("cb")),
_cb_name(getVar("cb", 0)->name()),
_prop_h(getMaterialProperty<Real>("h_name")),
_second_derivative_Fa(getMaterialPropertyDerivative<Real>("fa_name", _ca_name, _ca_name)),
_second_derivative_Fb(getMaterialPropertyDerivative<Real>("fb_name", _cb_name, _cb_name))
{
// reserve space for derivatives
_second_derivatives.resize(_nvar);
_third_derivatives.resize(_nvar);
_third_derivatives_ca.resize(_nvar);
_grad_args.resize(_nvar);
// Iterate over all coupled variables
for (unsigned int i = 0; i < _nvar; ++i)
{
MooseVariable * cvar = _coupled_moose_vars[i];
// get the second derivative material property (TODO:warn)
_second_derivatives[i] =
&getMaterialPropertyDerivative<Real>("fa_name", _ca_name, cvar->name());
// get the third derivative material properties
_third_derivatives[i].resize(_nvar);
for (unsigned int j = 0; j < _nvar; ++j)
_third_derivatives[i][j] = &getMaterialPropertyDerivative<Real>(
"fa_name", _ca_name, cvar->name(), _coupled_moose_vars[j]->name());
// third derivative for the on-diagonal jacobian
_third_derivatives_ca[i] =
&getMaterialPropertyDerivative<Real>("fa_name", _ca_name, cvar->name(), _ca_name);
// get the gradient
_grad_args[i] = &(cvar->gradSln());
}
}
示例6: getVar
MatReaction::MatReaction(const InputParameters & parameters)
: DerivativeMaterialInterface<JvarMapKernelInterface<Kernel>>(parameters),
_is_coupled(isCoupled("v")),
_v_name(_is_coupled ? getVar("v", 0)->name() : _var.name()),
_v(_is_coupled ? coupledValue("v") : _u),
_v_var(_is_coupled ? coupled("v") : _var.number()),
_L(getMaterialProperty<Real>("mob_name")),
_eta_name(_var.name()),
_dLdop(getMaterialPropertyDerivative<Real>("mob_name", _eta_name)),
_dLdv(getMaterialPropertyDerivative<Real>("mob_name", _v_name)),
_nvar(_coupled_moose_vars.size()),
_dLdarg(_nvar)
{
// Get reaction rate derivatives
for (unsigned int i = 0; i < _nvar; ++i)
{
MooseVariable * ivar = _coupled_moose_vars[i];
_dLdarg[i] = &getMaterialPropertyDerivative<Real>("mob_name", ivar->name());
}
}