How to use the slepc4py.SLEPc.EPS.Which function in slepc4py

To help you get started, we’ve selected a few slepc4py examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mathLab / RBniCS / rbnics / backends / basic / wrapping / slepc_eps_solver.py View on Github external
elif value == "smallest real":
                        self.eps.setWhichEigenpairs(SLEPc.EPS.Which.SMALLEST_REAL)
                    elif value == "largest imaginary":
                        self.eps.setWhichEigenpairs(SLEPc.EPS.Which.LARGEST_IMAGINARY)
                    elif value == "smallest imaginary":
                        self.eps.setWhichEigenpairs(SLEPc.EPS.Which.SMALLEST_IMAGINARY)
                    elif value == "target magnitude":
                        self.eps.setWhichEigenpairs(SLEPc.EPS.Which.TARGET_MAGNITUDE)
                        if "spectral_shift" in parameters:
                            self.eps.setTarget(parameters["spectral_shift"])
                    elif value == "target real":
                        self.eps.setWhichEigenpairs(SLEPc.EPS.Which.TARGET_REAL)
                        if "spectral_shift" in parameters:
                            self.eps.setTarget(parameters["spectral_shift"])
                    elif value == "target imaginary":
                        self.eps.setWhichEigenpairs(SLEPc.EPS.Which.TARGET_IMAGINARY)
                        if "spectral_shift" in parameters:
                            self.eps.setTarget(parameters["spectral_shift"])
                    else:
                        raise RuntimeError("Invalid spectrum type")
                elif key == "tolerance":
                    eps_tolerances[0] = value
                else:
                    raise RuntimeError("Invalid paramater passed to SLEPc EPS object.")
            self.eps.setTolerances(*eps_tolerances)
            # Finally, read in additional options from the command line
            self.eps.setFromOptions()
github mathLab / RBniCS / rbnics / backends / basic / wrapping / slepc_eps_solver.py View on Github external
assert value == "shift-and-invert"
                    st = self.eps.getST()
                    st.setType(SLEPc.ST.Type.SINVERT)
                elif key == "spectrum":
                    if value == "largest magnitude":
                        self.eps.setWhichEigenpairs(SLEPc.EPS.Which.LARGEST_MAGNITUDE)
                    elif value == "smallest magnitude":
                        self.eps.setWhichEigenpairs(SLEPc.EPS.Which.SMALLEST_MAGNITUDE)
                    elif value == "largest real":
                        self.eps.setWhichEigenpairs(SLEPc.EPS.Which.LARGEST_REAL)
                    elif value == "smallest real":
                        self.eps.setWhichEigenpairs(SLEPc.EPS.Which.SMALLEST_REAL)
                    elif value == "largest imaginary":
                        self.eps.setWhichEigenpairs(SLEPc.EPS.Which.LARGEST_IMAGINARY)
                    elif value == "smallest imaginary":
                        self.eps.setWhichEigenpairs(SLEPc.EPS.Which.SMALLEST_IMAGINARY)
                    elif value == "target magnitude":
                        self.eps.setWhichEigenpairs(SLEPc.EPS.Which.TARGET_MAGNITUDE)
                        if "spectral_shift" in parameters:
                            self.eps.setTarget(parameters["spectral_shift"])
                    elif value == "target real":
                        self.eps.setWhichEigenpairs(SLEPc.EPS.Which.TARGET_REAL)
                        if "spectral_shift" in parameters:
                            self.eps.setTarget(parameters["spectral_shift"])
                    elif value == "target imaginary":
                        self.eps.setWhichEigenpairs(SLEPc.EPS.Which.TARGET_IMAGINARY)
                        if "spectral_shift" in parameters:
                            self.eps.setTarget(parameters["spectral_shift"])
                    else:
                        raise RuntimeError("Invalid spectrum type")
                elif key == "tolerance":
                    eps_tolerances[0] = value
github mathLab / RBniCS / rbnics / backends / basic / wrapping / slepc_eps_solver.py View on Github external
else:
                        raise RuntimeError("Invalid solver type")
                elif key == "spectral_shift":
                    st = self.eps.getST()
                    st.setShift(value)
                elif key == "spectral_transform":
                    assert value == "shift-and-invert"
                    st = self.eps.getST()
                    st.setType(SLEPc.ST.Type.SINVERT)
                elif key == "spectrum":
                    if value == "largest magnitude":
                        self.eps.setWhichEigenpairs(SLEPc.EPS.Which.LARGEST_MAGNITUDE)
                    elif value == "smallest magnitude":
                        self.eps.setWhichEigenpairs(SLEPc.EPS.Which.SMALLEST_MAGNITUDE)
                    elif value == "largest real":
                        self.eps.setWhichEigenpairs(SLEPc.EPS.Which.LARGEST_REAL)
                    elif value == "smallest real":
                        self.eps.setWhichEigenpairs(SLEPc.EPS.Which.SMALLEST_REAL)
                    elif value == "largest imaginary":
                        self.eps.setWhichEigenpairs(SLEPc.EPS.Which.LARGEST_IMAGINARY)
                    elif value == "smallest imaginary":
                        self.eps.setWhichEigenpairs(SLEPc.EPS.Which.SMALLEST_IMAGINARY)
                    elif value == "target magnitude":
                        self.eps.setWhichEigenpairs(SLEPc.EPS.Which.TARGET_MAGNITUDE)
                        if "spectral_shift" in parameters:
                            self.eps.setTarget(parameters["spectral_shift"])
                    elif value == "target real":
                        self.eps.setWhichEigenpairs(SLEPc.EPS.Which.TARGET_REAL)
                        if "spectral_shift" in parameters:
                            self.eps.setTarget(parameters["spectral_shift"])
                    elif value == "target imaginary":
                        self.eps.setWhichEigenpairs(SLEPc.EPS.Which.TARGET_IMAGINARY)
github mathLab / RBniCS / rbnics / backends / basic / wrapping / slepc_eps_solver.py View on Github external
st.setType(SLEPc.ST.Type.SINVERT)
                elif key == "spectrum":
                    if value == "largest magnitude":
                        self.eps.setWhichEigenpairs(SLEPc.EPS.Which.LARGEST_MAGNITUDE)
                    elif value == "smallest magnitude":
                        self.eps.setWhichEigenpairs(SLEPc.EPS.Which.SMALLEST_MAGNITUDE)
                    elif value == "largest real":
                        self.eps.setWhichEigenpairs(SLEPc.EPS.Which.LARGEST_REAL)
                    elif value == "smallest real":
                        self.eps.setWhichEigenpairs(SLEPc.EPS.Which.SMALLEST_REAL)
                    elif value == "largest imaginary":
                        self.eps.setWhichEigenpairs(SLEPc.EPS.Which.LARGEST_IMAGINARY)
                    elif value == "smallest imaginary":
                        self.eps.setWhichEigenpairs(SLEPc.EPS.Which.SMALLEST_IMAGINARY)
                    elif value == "target magnitude":
                        self.eps.setWhichEigenpairs(SLEPc.EPS.Which.TARGET_MAGNITUDE)
                        if "spectral_shift" in parameters:
                            self.eps.setTarget(parameters["spectral_shift"])
                    elif value == "target real":
                        self.eps.setWhichEigenpairs(SLEPc.EPS.Which.TARGET_REAL)
                        if "spectral_shift" in parameters:
                            self.eps.setTarget(parameters["spectral_shift"])
                    elif value == "target imaginary":
                        self.eps.setWhichEigenpairs(SLEPc.EPS.Which.TARGET_IMAGINARY)
                        if "spectral_shift" in parameters:
                            self.eps.setTarget(parameters["spectral_shift"])
                    else:
                        raise RuntimeError("Invalid spectrum type")
                elif key == "tolerance":
                    eps_tolerances[0] = value
                else:
                    raise RuntimeError("Invalid paramater passed to SLEPc EPS object.")
github mathLab / RBniCS / rbnics / backends / basic / wrapping / slepc_eps_solver.py View on Github external
elif value == "smallest magnitude":
                        self.eps.setWhichEigenpairs(SLEPc.EPS.Which.SMALLEST_MAGNITUDE)
                    elif value == "largest real":
                        self.eps.setWhichEigenpairs(SLEPc.EPS.Which.LARGEST_REAL)
                    elif value == "smallest real":
                        self.eps.setWhichEigenpairs(SLEPc.EPS.Which.SMALLEST_REAL)
                    elif value == "largest imaginary":
                        self.eps.setWhichEigenpairs(SLEPc.EPS.Which.LARGEST_IMAGINARY)
                    elif value == "smallest imaginary":
                        self.eps.setWhichEigenpairs(SLEPc.EPS.Which.SMALLEST_IMAGINARY)
                    elif value == "target magnitude":
                        self.eps.setWhichEigenpairs(SLEPc.EPS.Which.TARGET_MAGNITUDE)
                        if "spectral_shift" in parameters:
                            self.eps.setTarget(parameters["spectral_shift"])
                    elif value == "target real":
                        self.eps.setWhichEigenpairs(SLEPc.EPS.Which.TARGET_REAL)
                        if "spectral_shift" in parameters:
                            self.eps.setTarget(parameters["spectral_shift"])
                    elif value == "target imaginary":
                        self.eps.setWhichEigenpairs(SLEPc.EPS.Which.TARGET_IMAGINARY)
                        if "spectral_shift" in parameters:
                            self.eps.setTarget(parameters["spectral_shift"])
                    else:
                        raise RuntimeError("Invalid spectrum type")
                elif key == "tolerance":
                    eps_tolerances[0] = value
                else:
                    raise RuntimeError("Invalid paramater passed to SLEPc EPS object.")
            self.eps.setTolerances(*eps_tolerances)
            # Finally, read in additional options from the command line
            self.eps.setFromOptions()
github mathLab / RBniCS / rbnics / backends / basic / wrapping / slepc_eps_solver.py View on Github external
st.setShift(value)
                elif key == "spectral_transform":
                    assert value == "shift-and-invert"
                    st = self.eps.getST()
                    st.setType(SLEPc.ST.Type.SINVERT)
                elif key == "spectrum":
                    if value == "largest magnitude":
                        self.eps.setWhichEigenpairs(SLEPc.EPS.Which.LARGEST_MAGNITUDE)
                    elif value == "smallest magnitude":
                        self.eps.setWhichEigenpairs(SLEPc.EPS.Which.SMALLEST_MAGNITUDE)
                    elif value == "largest real":
                        self.eps.setWhichEigenpairs(SLEPc.EPS.Which.LARGEST_REAL)
                    elif value == "smallest real":
                        self.eps.setWhichEigenpairs(SLEPc.EPS.Which.SMALLEST_REAL)
                    elif value == "largest imaginary":
                        self.eps.setWhichEigenpairs(SLEPc.EPS.Which.LARGEST_IMAGINARY)
                    elif value == "smallest imaginary":
                        self.eps.setWhichEigenpairs(SLEPc.EPS.Which.SMALLEST_IMAGINARY)
                    elif value == "target magnitude":
                        self.eps.setWhichEigenpairs(SLEPc.EPS.Which.TARGET_MAGNITUDE)
                        if "spectral_shift" in parameters:
                            self.eps.setTarget(parameters["spectral_shift"])
                    elif value == "target real":
                        self.eps.setWhichEigenpairs(SLEPc.EPS.Which.TARGET_REAL)
                        if "spectral_shift" in parameters:
                            self.eps.setTarget(parameters["spectral_shift"])
                    elif value == "target imaginary":
                        self.eps.setWhichEigenpairs(SLEPc.EPS.Which.TARGET_IMAGINARY)
                        if "spectral_shift" in parameters:
                            self.eps.setTarget(parameters["spectral_shift"])
                    else:
                        raise RuntimeError("Invalid spectrum type")