message: Optimize ElementRestriction::FillI and ElementRestriction::FillJAndData.
diff: @@ -317,10 +317,11 @@ int ElementRestriction::FillI(SparseMatrix &mat) const
  {
  I[i_L] = 0;
  });
  - MFEM_FORALL(e, ne,
  - {
  - for (int i = 0; i < elt_dofs; i++)
  + MFEM_FORALL(dof, ne*elt_dofs,
  {
  + const int e = dof/elt_dofs;
  + const int i = dof%elt_dofs;
  +
  int i_elts[Max];
  const int i_gm = e*elt_dofs + i;
  const int i_L = d_gather_map[i_gm];
  @@ -363,7 +364,6 @@ int ElementRestriction::FillI(SparseMatrix &mat) const
  }
  }
  }
  - }
  });
  // We need to sum the entries of I, we do it on CPU as it is very sequential.
  auto h_I = mat.HostReadWriteI();
  @@ -394,10 +394,11 @@ void ElementRestriction::FillJAndData(const Vector &ea_data,
  auto d_indices = indices.Read();
  auto d_gather_map = gather_map.Read();
  auto mat_ea = Reshape(ea_data.Read(), elt_dofs, elt_dofs, ne);
  - MFEM_FORALL(e, ne,
  - {
  - for (int i = 0; i < elt_dofs; i++)
  + MFEM_FORALL(dof, ne*elt_dofs,
  {
  + const int e = dof/elt_dofs;
  + const int i = dof%elt_dofs;
  +
  int i_elts[Max];
  int i_B[Max];
  const int i_gm = e*elt_dofs + i;
  @@ -463,7 +464,6 @@ void ElementRestriction::FillJAndData(const Vector &ea_data,
  }
  }
  }
  - }
  });
  // We need to shift again the entries of I, we do it on CPU as it is very
  // sequential.
  