当前位置: 首页>>代码示例>>C++>>正文


C++ MooseVariable::gradSln方法代码示例

本文整理汇总了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());
  }
}
开发者ID:AhmedAly83,项目名称:moose,代码行数:30,代码来源:KKSACBulkBase.C

示例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();
}
开发者ID:atomica,项目名称:moose,代码行数:10,代码来源:Coupleable.C

示例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();
}
开发者ID:aeslaughter,项目名称:moose,代码行数:17,代码来源:Coupleable.C

示例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());
  }
}
开发者ID:ChaliZhg,项目名称:moose,代码行数:41,代码来源:KKSCHBulk.C

示例5:

Real
MultiAppSamplePostprocessorTransferFlux::getValue(MooseVariable & variable) const
{
	return - _mat_prop * variable.gradSln()[0] * _normal[0];
}
开发者ID:DrRokkam,项目名称:mamba,代码行数:5,代码来源:MultiAppSamplePostprocessorTransferFlux.C


注:本文中的MooseVariable::gradSln方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。