def project_STS_eigenvectors_to_S_eigenvectors(bvEs, S): sizes = S.getSizes()[0] N = bvEs.getActiveColumns()[1] bv = SLEPc.BV().create(PETSc.COMM_SELF) bv.setSizes(sizes, N) bv.setActiveColumns(0, N) bv.setFromOptions() tmpvec3, tmpvec2 = S.getVecs() for i in range(N): tmpvec = bvEs.getColumn(i) S.mult(tmpvec, tmpvec2) bv.insertVec(i, tmpvec2) bvEs.restoreColumn(i, tmpvec) return bv
def help(args=None): import sys # program name try: prog = sys.argv[0] except Exception: prog = getattr(sys, 'executable', 'python') # arguments if args is None: args = sys.argv[1:] elif isinstance(args, str): args = args.split() else: args = [str(a) for a in args] # initialization import slepc4py slepc4py.init([prog, '-help'] + args) from slepc4py import SLEPc # and finally ... COMM = SLEPc.COMM_SELF if 'eps' in args: eps = SLEPc.EPS().create(comm=COMM) eps.setFromOptions() eps.destroy() del eps if 'svd' in args: svd = SLEPc.SVD().create(comm=COMM) svd.setFromOptions() svd.destroy() del svd if 'pep' in args: pep = SLEPc.PEP().create(comm=COMM) pep.setFromOptions() pep.destroy() del pep if 'nep' in args: nep = SLEPc.NEP().create(comm=COMM) nep.setFromOptions() nep.destroy() del nep if 'mfn' in args: mfn = SLEPc.MFN().create(comm=COMM) mfn.setFromOptions() mfn.destroy() del mfn if 'st' in args: st = SLEPc.ST().create(comm=COMM) st.setFromOptions() st.destroy() del st if 'bv' in args: bv = SLEPc.BV().create(comm=COMM) bv.setFromOptions() bv.destroy() del bv if 'rg' in args: rg = SLEPc.RG().create(comm=COMM) rg.setFromOptions() rg.destroy() del rg if 'fn' in args: fn = SLEPc.FN().create(comm=COMM) fn.setFromOptions() fn.destroy() del fn if 'ds' in args: ds = SLEPc.DS().create(comm=COMM) ds.setFromOptions() ds.destroy() del ds