(self)
| 1638 | return fmin, fmax |
| 1639 | |
| 1640 | def _check_material_frequencies(self): |
| 1641 | |
| 1642 | min_freq, max_freq = self._get_valid_material_frequencies() |
| 1643 | source_freqs = [ |
| 1644 | (s.src.frequency, 0 if s.src.width == 0 else 1 / s.src.width) |
| 1645 | for s in self.sources |
| 1646 | if hasattr(s.src, "frequency") |
| 1647 | ] |
| 1648 | |
| 1649 | dft_freqs = [] |
| 1650 | for dftf in self.dft_objects: |
| 1651 | dft_freqs.append(dftf.freq[0]) |
| 1652 | dft_freqs.append(dftf.freq[-1]) |
| 1653 | |
| 1654 | warn_src = ( |
| 1655 | "Note: your sources include frequencies outside the range of validity of the " |
| 1656 | + "material models. This is fine as long as you eventually only look at outputs " |
| 1657 | + "(fluxes, resonant modes, etc.) at valid frequencies." |
| 1658 | ) |
| 1659 | |
| 1660 | warn_dft_fmt = "DFT frequency {} is out of material's range of {}-{}" |
| 1661 | |
| 1662 | for sf in source_freqs: |
| 1663 | if sf[0] + 0.5 * sf[1] > max_freq or sf[0] - 0.5 * sf[1] < min_freq: |
| 1664 | warnings.warn(warn_src, RuntimeWarning) |
| 1665 | |
| 1666 | for dftf in dft_freqs: |
| 1667 | if dftf > max_freq or dftf < min_freq: |
| 1668 | warnings.warn( |
| 1669 | warn_dft_fmt.format(dftf, min_freq, max_freq), RuntimeWarning |
| 1670 | ) |
| 1671 | |
| 1672 | def _create_grid_volume(self, k: Vector3Type = None): |
| 1673 | dims = self._infer_dimensions(k) |
no test coverage detected