本文整理汇总了C++中MooseVariable::gradSln方法的典型用法代码示例。如果您正苦于以下问题:C++ MooseVariable::gradSln方法的具体用法?C++ MooseVariable::gradSln怎么用?C++ MooseVariable::gradSln使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MooseVariable
的用法示例。
在下文中一共展示了MooseVariable::gradSln方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
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());
}
}
示例2: coupledCallback
VariableGradient &
Coupleable::coupledGradient(const std::string & var_name, unsigned int comp)
{
coupledCallback(var_name, false);
if (_nodal)
mooseError("Nodal variables do not have gradients");
MooseVariable * var = getVar(var_name, comp);
return (_c_is_implicit) ? var->gradSln() : var->gradSlnOld();
}
示例3: coupledCallback
const VariableGradient &
Coupleable::coupledGradient(const std::string & var_name, unsigned int comp)
{
if (!isCoupled(var_name)) // Return default 0
return _default_gradient;
coupledCallback(var_name, false);
if (_nodal)
mooseError("Nodal variables do not have gradients");
MooseVariable * var = getVar(var_name, comp);
if (!_coupleable_neighbor)
return (_c_is_implicit) ? var->gradSln() : var->gradSlnOld();
else
return (_c_is_implicit) ? var->gradSlnNeighbor() : var->gradSlnOldNeighbor();
}
示例4:
KKSCHBulk::KKSCHBulk(const std::string & name, InputParameters parameters) :
DerivativeMaterialInterface<JvarMapInterface<CHBulk> >(name, parameters),
// number of coupled variables (ca, args_a[])
_nvar(_coupled_moose_vars.size()),
_Fa_name(getParam<std::string>("fa_name")),
_Fb_name(getParam<std::string>("fb_name")),
_h_name(getParam<std::string>("h_name")),
_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 = this->_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());
}
}
示例5:
Real
MultiAppSamplePostprocessorTransferFlux::getValue(MooseVariable & variable) const
{
return - _mat_prop * variable.gradSln()[0] * _normal[0];
}