Пример #1
0
void
FaceFaceConstraint::computeResidualSide(Moose::ConstraintType side)
{
  switch (side)
  {
  case Moose::Master:
    {
      DenseVector<Number> & re_master = _assembly.residualBlock(_master_var.number());
      for (_qp = 0; _qp < _qrule->n_points(); _qp++)
      {
        for (_i = 0; _i < _test_master.size(); _i++)
          re_master(_i) += _JxW_lm[_qp] * computeQpResidualSide(Moose::Master);
      }
    }
    break;

  case Moose::Slave:
    {
      DenseVector<Number> & re_slave = _assembly.residualBlock(_slave_var.number());
      for (_qp = 0; _qp < _qrule->n_points(); _qp++)
      {
        for (_i = 0; _i < _test_slave.size(); _i++)
          re_slave(_i) += _JxW_lm[_qp] * _coord[_qp] * computeQpResidualSide(Moose::Slave);
      }
    }
    break;
  }
}
Пример #2
0
void
FaceFaceConstraint::computeResidualSide()
{
  // TODO: refactor these reinits into NonlinearSystem
  {
    _assembly.reinit(_elem_master);
    _master_var.prepare();
    _assembly.prepare();
    _assembly.reinitAtPhysical(_elem_master, _phys_points_master);

    DenseVector<Number> & re_master = _assembly.residualBlock(_master_var.index());
    for (_qp = 0; _qp < _qrule->n_points(); _qp++)
    {
      for (_i = 0; _i < _test_master.size(); _i++)
        re_master(_i) += _JxW_lm[_qp] * computeQpResidualSide(Moose::Master);
    }
    _assembly.addResidual(_fe_problem.residualVector(Moose::KT_NONTIME), Moose::KT_NONTIME);
  }

  // TODO: refactor these reinits into NonlinearSystem
  {
    _assembly.reinit(_elem_slave);
    _slave_var.prepare();
    _assembly.prepare();
    _assembly.reinitAtPhysical(_elem_slave, _phys_points_slave);

    DenseVector<Number> & re_slave = _assembly.residualBlock(_slave_var.index());
    for (_qp = 0; _qp < _qrule->n_points(); _qp++)
    {
      for (_i = 0; _i < _test_slave.size(); _i++)
        re_slave(_i) += _JxW_lm[_qp] * _coord[_qp] * computeQpResidualSide(Moose::Slave);
    }
    _assembly.addResidual(_fe_problem.residualVector(Moose::KT_NONTIME), Moose::KT_NONTIME);
  }
}