ngsPETSc.vec
============

.. py:module:: ngsPETSc.vec

.. autoapi-nested-parse::

   This module contains all the functions related to the NGSolve vector -
   PETSc vector mapping using the petsc4py interface.



Classes
-------

.. autoapisummary::

   ngsPETSc.vec.VectorMapping


Module Contents
---------------

.. py:class:: VectorMapping(parDescr, prefix='ngs_')

   This class creates a mapping between a PETSc vector and NGSolve
   vectors

   :arg parDescr: the finite element space for the vector or tuple (dofs, freeDofs)
   :arg prefix: prefix for PETSc options



   .. py:attribute:: dofs


   .. py:attribute:: sVec


   .. py:attribute:: pVec


   .. py:attribute:: ngsToPETScScat


   .. py:method:: petscVec(ngsVec, petscVec=None)

      This function generate a PETSc vector from a NGSolve vector

      :arg ngsVec: the NGSolve vector
      :arg petscVec: the PETSc vector to be loaded with NGSolve
      vector, if None new PETSc vector is generated, by deafault None.




   .. py:method:: ngsVec(petscVec, ngsVec=None)

      This function generate a NGSolve vector from a PETSc vector

      :arg petscVec: the PETSc vector
      :arg ngsVec: the NGSolve vector vector to be loaded with PETSc
      vector, if None new PETSc vector is generated, by deafault None.




