Example #1
0
void AssemblyF2::boundary_assembly(FEMContext & c)
{
  if (rb_sys.get_mesh().get_boundary_info().has_boundary_id
      (&c.get_elem(), c.side, BOUNDARY_ID_MAX_X))
    {
      const unsigned int u_var = 0;
      const unsigned int w_var = 2;

      FEBase * side_fe = libmesh_nullptr;
      c.get_side_fe(u_var, side_fe);

      const std::vector<Real> & JxW_side = side_fe->get_JxW();

      const std::vector<std::vector<Real> > & phi_side = side_fe->get_phi();

      // The number of local degrees of freedom in each variable
      const unsigned int n_w_dofs = c.get_dof_indices(w_var).size();

      // Now we will build the affine operator
      unsigned int n_qpoints = c.get_side_qrule().n_points();
      DenseSubVector<Number> & Fw = c.get_elem_residual(w_var);

      for (unsigned int qp=0; qp < n_qpoints; qp++)
        for (unsigned int i=0; i < n_w_dofs; i++)
          Fw(i) += JxW_side[qp] * (1. * phi_side[i][qp]);
    }
}
Example #2
0
void AssemblyF1::boundary_assembly(FEMContext &c)
{
  if(rb_sys.get_mesh().boundary_info->has_boundary_id(c.elem, c.side, BOUNDARY_ID_MAX_X) )
  {
    const unsigned int u_var = 0;
    const unsigned int v_var = 1;

    const std::vector<Real> &JxW_side =
      c.side_fe_var[u_var]->get_JxW();

    const std::vector<std::vector<Real> >& phi_side =
      c.side_fe_var[u_var]->get_phi();

    // The number of local degrees of freedom in each variable
    const unsigned int n_v_dofs = c.dof_indices_var[v_var].size();

    // Now we will build the affine operator
    unsigned int n_qpoints = c.side_qrule->n_points();
    DenseSubVector<Number>& Fv = c.get_elem_residual(v_var);

    for (unsigned int qp=0; qp < n_qpoints; qp++)
      for (unsigned int i=0; i < n_v_dofs; i++)
      {
        Fv(i) += JxW_side[qp] * ( 1. * phi_side[i][qp] );
      }
  }
}