parameters: (A: PETSc.Mat,
        a: FormMetaClass,
        bcs: typing.List[DirichletBCMetaClass] = [],
        diagonal: float = 1.0,
        coeffs=Coefficients(None, None))
return_statement: return A
docstring: Assemble bilinear form into a matrix. The returned matrix is not
      finalised, i.e. ghost values are not accumulated.
docstring_summary: Assemble bilinear form into a matrix. The returned matrix is not
      finalised, i.e. ghost values are not accumulated.
docstring_tokens: Assemble bilinear form into a matrix . The returned matrix is not finalised i . e . ghost values are not accumulated .
function: def _(A: PETSc.Mat,
        a: FormMetaClass,
        bcs: typing.List[DirichletBCMetaClass] = [],
        diagonal: float = 1.0,
        coeffs=Coefficients(None, None)) -> PETSc.Mat:
      """Assemble bilinear form into a matrix. The returned matrix is not
      finalised, i.e. ghost values are not accumulated.
  
      """
      c = (coeffs[0] if coeffs[0] is not None else pack_constants(a),
           coeffs[1] if coeffs[1] is not None else pack_coefficients(a))
      _cpp.fem.petsc.assemble_matrix(A, a, c[0], c[1], bcs)
      if a.function_spaces[0].id == a.function_spaces[1].id:
          A.assemblyBegin(PETSc.Mat.AssemblyType.FLUSH)
          A.assemblyEnd(PETSc.Mat.AssemblyType.FLUSH)
          _cpp.fem.petsc.insert_diagonal(A, a.function_spaces[0], bcs, diagonal)
      return A
function_tokens: def _ ( A : PETSc . Mat , a : FormMetaClass , bcs : typing . List [ DirichletBCMetaClass ] = [ ] , diagonal : float = 1.0 , coeffs = Coefficients ( None , None ) ) -> PETSc . Mat : c = ( coeffs [ 0 ] if coeffs [ 0 ] is not None else pack_constants ( a ) , coeffs [ 1 ] if coeffs [ 1 ] is not None else pack_coefficients ( a ) ) _cpp . fem . petsc . assemble_matrix ( A , a , c [ 0 ] , c [ 1 ] , bcs ) if a . function_spaces [ 0 ] . id == a . function_spaces [ 1 ] . id : A . assemblyBegin ( PETSc . Mat . AssemblyType . FLUSH ) A . assemblyEnd ( PETSc . Mat . AssemblyType . FLUSH ) _cpp . fem . petsc . insert_diagonal ( A , a . function_spaces [ 0 ] , bcs , diagonal ) return A