15641 lines
No EOL
668 KiB
HTML
15641 lines
No EOL
668 KiB
HTML
|
|
<!doctype html>
|
|
<html lang="en" class="no-js">
|
|
<head>
|
|
|
|
<meta charset="utf-8">
|
|
<meta name="viewport" content="width=device-width,initial-scale=1">
|
|
|
|
<meta name="description" content="Electromagnetic simulation tools">
|
|
|
|
|
|
|
|
<link rel="canonical" href="https://mpxd.net/docs/meanas/print_page/">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<link rel="icon" href="../assets/images/favicon.png">
|
|
<meta name="generator" content="mkdocs-1.6.1, mkdocs-material-9.7.6">
|
|
|
|
|
|
|
|
<title>Print Site - meanas</title>
|
|
|
|
|
|
|
|
<link rel="stylesheet" href="../assets/stylesheets/main.484c7ddc.min.css">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<link rel="stylesheet" href="../css/print-site.css">
|
|
|
|
<link rel="stylesheet" href="../css/print-site-material.css">
|
|
|
|
<link rel="stylesheet" href="../assets/_mkdocstrings.css">
|
|
|
|
<link rel="stylesheet" href="../stylesheets/extra.css">
|
|
|
|
<script>__md_scope=new URL("/docs/meanas/",location),__md_hash=e=>[...e].reduce(((e,_)=>(e<<5)-e+_.charCodeAt(0)),0),__md_get=(e,_=localStorage,t=__md_scope)=>JSON.parse(_.getItem(t.pathname+"."+e)),__md_set=(e,_,t=localStorage,a=__md_scope)=>{try{t.setItem(a.pathname+"."+e,JSON.stringify(_))}catch(e){}}</script>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<script type="text/javascript">
|
|
document.addEventListener('DOMContentLoaded', function () {
|
|
remove_material_navigation();remove_mkdocs_theme_navigation();generate_toc();
|
|
})
|
|
</script>
|
|
</head>
|
|
|
|
|
|
<body dir="ltr">
|
|
|
|
|
|
<input class="md-toggle" data-md-toggle="drawer" type="checkbox" id="__drawer" autocomplete="off">
|
|
<input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
|
|
<label class="md-overlay" for="__drawer"></label>
|
|
<div data-md-component="skip">
|
|
|
|
|
|
<a href="#index" class="md-skip">
|
|
Skip to content
|
|
</a>
|
|
|
|
</div>
|
|
<div data-md-component="announce">
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<header class="md-header md-header--shadow" data-md-component="header">
|
|
<nav class="md-header__inner md-grid" aria-label="Header">
|
|
<a href=".." title="meanas" class="md-header__button md-logo" aria-label="meanas" data-md-component="logo">
|
|
|
|
|
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 8a3 3 0 0 0 3-3 3 3 0 0 0-3-3 3 3 0 0 0-3 3 3 3 0 0 0 3 3m0 3.54C9.64 9.35 6.5 8 3 8v11c3.5 0 6.64 1.35 9 3.54 2.36-2.19 5.5-3.54 9-3.54V8c-3.5 0-6.64 1.35-9 3.54"/></svg>
|
|
|
|
</a>
|
|
<label class="md-header__button md-icon" for="__drawer">
|
|
|
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3 6h18v2H3zm0 5h18v2H3zm0 5h18v2H3z"/></svg>
|
|
</label>
|
|
<div class="md-header__title" data-md-component="header-title">
|
|
<div class="md-header__ellipsis">
|
|
<div class="md-header__topic">
|
|
<span class="md-ellipsis">
|
|
meanas
|
|
</span>
|
|
</div>
|
|
<div class="md-header__topic" data-md-component="header-topic">
|
|
<span class="md-ellipsis">
|
|
|
|
Print Site
|
|
|
|
</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<script>var palette=__md_get("__palette");if(palette&&palette.color){if("(prefers-color-scheme)"===palette.color.media){var media=matchMedia("(prefers-color-scheme: light)"),input=document.querySelector(media.matches?"[data-md-color-media='(prefers-color-scheme: light)']":"[data-md-color-media='(prefers-color-scheme: dark)']");palette.color.media=input.getAttribute("data-md-color-media"),palette.color.scheme=input.getAttribute("data-md-color-scheme"),palette.color.primary=input.getAttribute("data-md-color-primary"),palette.color.accent=input.getAttribute("data-md-color-accent")}for(var[key,value]of Object.entries(palette.color))document.body.setAttribute("data-md-color-"+key,value)}</script>
|
|
|
|
|
|
|
|
|
|
|
|
<label class="md-header__button md-icon" for="__search">
|
|
|
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.52 6.52 0 0 1 9.5 16 6.5 6.5 0 0 1 3 9.5 6.5 6.5 0 0 1 9.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5"/></svg>
|
|
</label>
|
|
<div class="md-search" data-md-component="search" role="dialog">
|
|
<label class="md-search__overlay" for="__search"></label>
|
|
<div class="md-search__inner" role="search">
|
|
<form class="md-search__form" name="search">
|
|
<input type="text" class="md-search__input" name="query" aria-label="Search" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="search-query" required>
|
|
<label class="md-search__icon md-icon" for="__search">
|
|
|
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.52 6.52 0 0 1 9.5 16 6.5 6.5 0 0 1 3 9.5 6.5 6.5 0 0 1 9.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5"/></svg>
|
|
|
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11z"/></svg>
|
|
</label>
|
|
<nav class="md-search__options" aria-label="Search">
|
|
|
|
<button type="reset" class="md-search__icon md-icon" title="Clear" aria-label="Clear" tabindex="-1">
|
|
|
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"/></svg>
|
|
</button>
|
|
</nav>
|
|
|
|
</form>
|
|
<div class="md-search__output">
|
|
<div class="md-search__scrollwrap" tabindex="0" data-md-scrollfix>
|
|
<div class="md-search-result" data-md-component="search-result">
|
|
<div class="md-search-result__meta">
|
|
Initializing search
|
|
</div>
|
|
<ol class="md-search-result__list" role="presentation"></ol>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
<div class="md-header__source">
|
|
<a href="https://mpxd.net/code/jan/meanas" title="Go to repository" class="md-source" data-md-component="source">
|
|
<div class="md-source__icon md-icon">
|
|
|
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--! Font Awesome Free 7.1.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2025 Fonticons, Inc.--><path d="M439.6 236.1 244 40.5c-5.4-5.5-12.8-8.5-20.4-8.5s-15 3-20.4 8.4L162.5 81l51.5 51.5c27.1-9.1 52.7 16.8 43.4 43.7l49.7 49.7c34.2-11.8 61.2 31 35.5 56.7-26.5 26.5-70.2-2.9-56-37.3L240.3 199v121.9c25.3 12.5 22.3 41.8 9.1 55-6.4 6.4-15.2 10.1-24.3 10.1s-17.8-3.6-24.3-10.1c-17.6-17.6-11.1-46.9 11.2-56v-123c-20.8-8.5-24.6-30.7-18.6-45L142.6 101 8.5 235.1C3 240.6 0 247.9 0 255.5s3 15 8.5 20.4l195.6 195.7c5.4 5.4 12.7 8.4 20.4 8.4s15-3 20.4-8.4l194.7-194.7c5.4-5.4 8.4-12.8 8.4-20.4s-3-15-8.4-20.4"/></svg>
|
|
</div>
|
|
<div class="md-source__repository">
|
|
meanas
|
|
</div>
|
|
</a>
|
|
</div>
|
|
|
|
</nav>
|
|
|
|
</header>
|
|
|
|
<div class="md-container" data-md-component="container">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<main class="md-main" data-md-component="main">
|
|
<div class="md-main__inner md-grid">
|
|
|
|
|
|
|
|
<div class="md-sidebar md-sidebar--primary" data-md-component="sidebar" data-md-type="navigation" >
|
|
<div class="md-sidebar__scrollwrap">
|
|
<div class="md-sidebar__inner">
|
|
|
|
|
|
|
|
|
|
<nav class="md-nav md-nav--primary" aria-label="Navigation" data-md-level="0">
|
|
<label class="md-nav__title" for="__drawer">
|
|
<a href=".." title="meanas" class="md-nav__button md-logo" aria-label="meanas" data-md-component="logo">
|
|
|
|
|
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 8a3 3 0 0 0 3-3 3 3 0 0 0-3-3 3 3 0 0 0-3 3 3 3 0 0 0 3 3m0 3.54C9.64 9.35 6.5 8 3 8v11c3.5 0 6.64 1.35 9 3.54 2.36-2.19 5.5-3.54 9-3.54V8c-3.5 0-6.64 1.35-9 3.54"/></svg>
|
|
|
|
</a>
|
|
meanas
|
|
</label>
|
|
|
|
<div class="md-nav__source">
|
|
<a href="https://mpxd.net/code/jan/meanas" title="Go to repository" class="md-source" data-md-component="source">
|
|
<div class="md-source__icon md-icon">
|
|
|
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--! Font Awesome Free 7.1.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2025 Fonticons, Inc.--><path d="M439.6 236.1 244 40.5c-5.4-5.5-12.8-8.5-20.4-8.5s-15 3-20.4 8.4L162.5 81l51.5 51.5c27.1-9.1 52.7 16.8 43.4 43.7l49.7 49.7c34.2-11.8 61.2 31 35.5 56.7-26.5 26.5-70.2-2.9-56-37.3L240.3 199v121.9c25.3 12.5 22.3 41.8 9.1 55-6.4 6.4-15.2 10.1-24.3 10.1s-17.8-3.6-24.3-10.1c-17.6-17.6-11.1-46.9 11.2-56v-123c-20.8-8.5-24.6-30.7-18.6-45L142.6 101 8.5 235.1C3 240.6 0 247.9 0 255.5s3 15 8.5 20.4l195.6 195.7c5.4 5.4 12.7 8.4 20.4 8.4s15-3 20.4-8.4l194.7-194.7c5.4-5.4 8.4-12.8 8.4-20.4s-3-15-8.4-20.4"/></svg>
|
|
</div>
|
|
<div class="md-source__repository">
|
|
meanas
|
|
</div>
|
|
</a>
|
|
</div>
|
|
|
|
<ul class="md-nav__list" data-md-scrollfix>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="md-nav__item">
|
|
<a href=".." class="md-nav__link">
|
|
|
|
|
|
|
|
<span class="md-ellipsis">
|
|
|
|
|
|
Home
|
|
|
|
|
|
|
|
</span>
|
|
|
|
|
|
|
|
</a>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="md-nav__item md-nav__item--section md-nav__item--nested">
|
|
|
|
|
|
|
|
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_2" >
|
|
|
|
|
|
<div class="md-nav__link md-nav__container">
|
|
<a href="../api/" class="md-nav__link ">
|
|
|
|
|
|
|
|
<span class="md-ellipsis">
|
|
|
|
|
|
API
|
|
|
|
|
|
|
|
</span>
|
|
|
|
|
|
|
|
</a>
|
|
|
|
|
|
<label class="md-nav__link " for="__nav_2" id="__nav_2_label" tabindex="">
|
|
<span class="md-nav__icon md-icon"></span>
|
|
</label>
|
|
|
|
</div>
|
|
|
|
<nav class="md-nav" data-md-level="1" aria-labelledby="__nav_2_label" aria-expanded="false">
|
|
<label class="md-nav__title" for="__nav_2">
|
|
<span class="md-nav__icon md-icon"></span>
|
|
|
|
|
|
API
|
|
|
|
|
|
</label>
|
|
<ul class="md-nav__list" data-md-scrollfix>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="md-nav__item">
|
|
<a href="../api/meanas/" class="md-nav__link">
|
|
|
|
|
|
|
|
<span class="md-ellipsis">
|
|
|
|
|
|
meanas
|
|
|
|
|
|
|
|
</span>
|
|
|
|
|
|
|
|
</a>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="md-nav__item">
|
|
<a href="../api/eigensolvers/" class="md-nav__link">
|
|
|
|
|
|
|
|
<span class="md-ellipsis">
|
|
|
|
|
|
eigensolvers
|
|
|
|
|
|
|
|
</span>
|
|
|
|
|
|
|
|
</a>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="md-nav__item">
|
|
<a href="../api/fdfd/" class="md-nav__link">
|
|
|
|
|
|
|
|
<span class="md-ellipsis">
|
|
|
|
|
|
fdfd
|
|
|
|
|
|
|
|
</span>
|
|
|
|
|
|
|
|
</a>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="md-nav__item">
|
|
<a href="../api/waveguides/" class="md-nav__link">
|
|
|
|
|
|
|
|
<span class="md-ellipsis">
|
|
|
|
|
|
waveguides
|
|
|
|
|
|
|
|
</span>
|
|
|
|
|
|
|
|
</a>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="md-nav__item">
|
|
<a href="../api/fdtd/" class="md-nav__link">
|
|
|
|
|
|
|
|
<span class="md-ellipsis">
|
|
|
|
|
|
fdtd
|
|
|
|
|
|
|
|
</span>
|
|
|
|
|
|
|
|
</a>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="md-nav__item">
|
|
<a href="../api/fdmath/" class="md-nav__link">
|
|
|
|
|
|
|
|
<span class="md-ellipsis">
|
|
|
|
|
|
fdmath
|
|
|
|
|
|
|
|
</span>
|
|
|
|
|
|
|
|
</a>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
</ul>
|
|
</nav>
|
|
|
|
</li>
|
|
|
|
|
|
|
|
</ul>
|
|
</nav>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
<div class="md-sidebar md-sidebar--secondary" data-md-component="sidebar" data-md-type="toc" >
|
|
<div class="md-sidebar__scrollwrap">
|
|
<div class="md-sidebar__inner">
|
|
|
|
|
|
<nav class="md-nav md-nav--secondary" aria-label="Table of contents">
|
|
|
|
|
|
|
|
|
|
<label class="md-nav__title" for="__toc">
|
|
<span class="md-nav__icon md-icon"></span>
|
|
Table of contents
|
|
</label>
|
|
<ul class="md-nav__list" data-md-component="toc" data-md-scrollfix>
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#index" class="md-nav__link">
|
|
<span class="md-ellipsis">
|
|
|
|
1 Home
|
|
|
|
</span>
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#section-2" class="md-nav__link">
|
|
<span class="md-ellipsis">
|
|
|
|
2 API
|
|
|
|
</span>
|
|
</a>
|
|
|
|
<nav class="md-nav" aria-label="2 API">
|
|
<ul class="md-nav__list">
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#api" class="md-nav__link">
|
|
<span class="md-ellipsis">
|
|
|
|
2.1 Overview
|
|
|
|
</span>
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#api-meanas" class="md-nav__link">
|
|
<span class="md-ellipsis">
|
|
|
|
2.2 meanas
|
|
|
|
</span>
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#api-eigensolvers" class="md-nav__link">
|
|
<span class="md-ellipsis">
|
|
|
|
2.3 eigensolvers
|
|
|
|
</span>
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#api-fdfd" class="md-nav__link">
|
|
<span class="md-ellipsis">
|
|
|
|
2.4 fdfd
|
|
|
|
</span>
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#api-waveguides" class="md-nav__link">
|
|
<span class="md-ellipsis">
|
|
|
|
2.5 waveguides
|
|
|
|
</span>
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#api-fdtd" class="md-nav__link">
|
|
<span class="md-ellipsis">
|
|
|
|
2.6 fdtd
|
|
|
|
</span>
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#api-fdmath" class="md-nav__link">
|
|
<span class="md-ellipsis">
|
|
|
|
2.7 fdmath
|
|
|
|
</span>
|
|
</a>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
</nav>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</nav>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
<div class="md-content" data-md-component="content">
|
|
|
|
<article class="md-content__inner md-typeset">
|
|
|
|
|
|
|
|
|
|
|
|
<div id="print-site-page" class="print-site-enumerate-headings print-site-enumerate-figures">
|
|
<section class="print-page">
|
|
<div id="print-page-toc" data-toc-depth="3">
|
|
<nav role='navigation' class='print-page-toc-nav'>
|
|
<h1 class='print-page-toc-title'>Table of Contents</h1>
|
|
</nav>
|
|
</div>
|
|
</section>
|
|
<section class="print-page" id="index" heading-number="1"><h1 id="index-meanas">meanas<a class="headerlink" href="#index-meanas" title="Permanent link">¶</a></h1>
|
|
<p><code>meanas</code> is a Python package for finite-difference electromagnetic simulation.
|
|
It combines:</p>
|
|
<ul>
|
|
<li><code>meanas.fdfd</code> for frequency-domain operators, sources, waveguide modes, and SCPML</li>
|
|
<li><code>meanas.fdtd</code> for Yee-grid timestepping, CPML, energy/flux accounting, and phasor extraction</li>
|
|
<li><code>meanas.fdmath</code> for the shared discrete operators and derivations underneath both solvers</li>
|
|
</ul>
|
|
<p>This documentation is built directly from the package docstrings. The API pages
|
|
are the source of truth for the mathematical derivations and calling
|
|
conventions.</p>
|
|
<h2 id="index-recommended-starting-points">Recommended starting points<a class="headerlink" href="#index-recommended-starting-points" title="Permanent link">¶</a></h2>
|
|
<ul>
|
|
<li>Use the <a href="#api-fdtd">FDTD API</a> when you need time-domain stepping, CPML, or
|
|
phasor extraction.</li>
|
|
<li>Use the <a href="#api-fdfd">FDFD API</a> when you need driven frequency-domain solves
|
|
or operator algebra.</li>
|
|
<li>Use the <a href="#api-waveguides">Waveguide API</a> for mode solving, port sources, and
|
|
overlap windows.</li>
|
|
<li>Use the <a href="#api-fdmath">fdmath API</a> when you need the lower-level finite-difference
|
|
operators or the derivation background shared across the package.</li>
|
|
</ul>
|
|
<h2 id="index-build-outputs">Build outputs<a class="headerlink" href="#index-build-outputs" title="Permanent link">¶</a></h2>
|
|
<p>The docs build generates two HTML views from the same source:</p>
|
|
<ul>
|
|
<li>a normal multi-page site</li>
|
|
<li>a print-oriented combined page under <code>site/print_page/</code></li>
|
|
</ul>
|
|
<p>If <code>htmlark</code> is installed, <code>./make_docs.sh</code> also writes a fully inlined
|
|
<code>site/standalone.html</code>.</p></section>
|
|
<section class='print-page md-section' id='section-2' heading-number='2'>
|
|
<h1>API<a class='headerlink' href='#section-2' title='Permanent link'></a>
|
|
</h1>
|
|
<section class="print-page" id="api" heading-number="2.1"><h1 id="api-api-overview">API Overview<a class="headerlink" href="#api-api-overview" title="Permanent link">¶</a></h1>
|
|
<p>The package is documented directly from its docstrings. The most useful entry
|
|
points are:</p>
|
|
<ul>
|
|
<li><a href="#api-meanas">meanas</a>: top-level package overview</li>
|
|
<li><a href="#api-eigensolvers">eigensolvers</a>: generic eigenvalue utilities used by the mode solvers</li>
|
|
<li><a href="#api-fdfd">fdfd</a>: frequency-domain operators, sources, PML, solvers, and far-field transforms</li>
|
|
<li><a href="#api-waveguides">waveguides</a>: straight, cylindrical, and 3D waveguide mode helpers</li>
|
|
<li><a href="#api-fdtd">fdtd</a>: timestepping, CPML, energy/flux helpers, and phasor extraction</li>
|
|
<li><a href="#api-fdmath">fdmath</a>: shared discrete operators, vectorization helpers, and derivation background</li>
|
|
</ul>
|
|
<p>The waveguide and FDTD pages are the best places to start if you want the
|
|
mathematical derivations rather than just the callable reference.</p></section><section class="print-page" id="api-meanas" heading-number="2.2"><h1 id="api-meanas-meanas_1">meanas<a class="headerlink" href="#api-meanas-meanas_1" title="Permanent link">¶</a></h1>
|
|
|
|
|
|
<div class="doc doc-object doc-module">
|
|
|
|
|
|
|
|
<h2 id="api-meanas-meanas" class="doc doc-heading">
|
|
<code class="doc-symbol doc-symbol-heading doc-symbol-module"></code> <span class="doc doc-object-name doc-module-name">meanas</span>
|
|
|
|
|
|
<a href="#api-meanas-meanas" class="headerlink" title="Permanent link">¶</a></h2>
|
|
|
|
<div class="doc doc-contents first">
|
|
|
|
<p>Electromagnetic simulation tools</p>
|
|
<p>See the readme or <code>import meanas; help(meanas)</code> for more info.</p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="doc doc-children">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div></section><section class="print-page" id="api-eigensolvers" heading-number="2.3"><h1 id="api-eigensolvers-eigensolvers">eigensolvers<a class="headerlink" href="#api-eigensolvers-eigensolvers" title="Permanent link">¶</a></h1>
|
|
|
|
|
|
<div class="doc doc-object doc-module">
|
|
|
|
|
|
|
|
<h2 id="api-eigensolvers-meanas.eigensolvers" class="doc doc-heading">
|
|
<code class="doc-symbol doc-symbol-heading doc-symbol-module"></code> <span class="doc doc-object-name doc-module-name">meanas.eigensolvers</span>
|
|
|
|
|
|
<a href="#api-eigensolvers-meanas.eigensolvers" class="headerlink" title="Permanent link">¶</a></h2>
|
|
|
|
<div class="doc doc-contents first">
|
|
|
|
<p>Solvers for eigenvalue / eigenvector problems</p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="doc doc-children">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="doc doc-object doc-function">
|
|
|
|
|
|
<h3 id="api-eigensolvers-meanas.eigensolvers.power_iteration" class="doc doc-heading">
|
|
<code class="doc-symbol doc-symbol-heading doc-symbol-function"></code> <span class="doc doc-object-name doc-function-name">power_iteration</span>
|
|
|
|
|
|
<a href="#api-eigensolvers-meanas.eigensolvers.power_iteration" class="headerlink" title="Permanent link">¶</a></h3>
|
|
<div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#api-eigensolvers-__codelineno-0-1"></a><span class="nf">power_iteration</span><span class="p">(</span>
|
|
<a id="__codelineno-0-2" name="__codelineno-0-2" href="#api-eigensolvers-__codelineno-0-2"></a> <span class="n">operator</span><span class="p">:</span> <span class="n">spmatrix</span><span class="p">,</span>
|
|
<a id="__codelineno-0-3" name="__codelineno-0-3" href="#api-eigensolvers-__codelineno-0-3"></a> <span class="n">guess_vector</span><span class="p">:</span> <span class="n">NDArray</span><span class="p">[</span><span class="n">complex128</span><span class="p">]</span> <span class="o">|</span> <span class="kc">None</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
|
|
<a id="__codelineno-0-4" name="__codelineno-0-4" href="#api-eigensolvers-__codelineno-0-4"></a> <span class="n">iterations</span><span class="p">:</span> <span class="nb">int</span> <span class="o">=</span> <span class="mi">20</span><span class="p">,</span>
|
|
<a id="__codelineno-0-5" name="__codelineno-0-5" href="#api-eigensolvers-__codelineno-0-5"></a><span class="p">)</span> <span class="o">-></span> <span class="nb">tuple</span><span class="p">[</span><span class="nb">complex</span><span class="p">,</span> <span class="n">NDArray</span><span class="p">[</span><span class="n">numpy</span><span class="o">.</span><span class="n">complex128</span><span class="p">]]</span>
|
|
</code></pre></div>
|
|
|
|
<div class="doc doc-contents ">
|
|
|
|
<p>Use power iteration to estimate the dominant eigenvector of a matrix.</p>
|
|
|
|
|
|
<p><span class="doc-section-title">Parameters:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
<th>Default</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>operator</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title="scipy.sparse.spmatrix" href="#scipy.sparse.spmatrix">spmatrix</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Matrix to analyze.</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>guess_vector</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title="numpy.typing.NDArray" href="#numpy.typing.NDArray">NDArray</a>[<a class="autorefs autorefs-internal" title="numpy.complex128" href="#numpy.complex128">complex128</a>] | None</code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Starting point for the eigenvector. Default is a randomly chosen vector.</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<code>None</code>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>iterations</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#index-recommended-starting-points">int</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Number of iterations to perform. Default 20.</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<code>20</code>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
<p><span class="doc-section-title">Returns:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#tuple">tuple</a>[<a class="autorefs autorefs-internal" href="#complex">complex</a>, <a class="autorefs autorefs-internal" title="numpy.typing.NDArray" href="#numpy.typing.NDArray">NDArray</a>[<a class="autorefs autorefs-internal" title="numpy.complex128" href="#numpy.complex128">complex128</a>]]</code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>(Largest-magnitude eigenvalue, Corresponding eigenvector estimate)</p>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="doc doc-object doc-function">
|
|
|
|
|
|
<h3 id="api-eigensolvers-meanas.eigensolvers.rayleigh_quotient_iteration" class="doc doc-heading">
|
|
<code class="doc-symbol doc-symbol-heading doc-symbol-function"></code> <span class="doc doc-object-name doc-function-name">rayleigh_quotient_iteration</span>
|
|
|
|
|
|
<a href="#api-eigensolvers-meanas.eigensolvers.rayleigh_quotient_iteration" class="headerlink" title="Permanent link">¶</a></h3>
|
|
<div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#api-eigensolvers-__codelineno-0-1"></a><span class="nf">rayleigh_quotient_iteration</span><span class="p">(</span>
|
|
<a id="__codelineno-0-2" name="__codelineno-0-2" href="#api-eigensolvers-__codelineno-0-2"></a> <span class="n">operator</span><span class="p">:</span> <span class="n">spmatrix</span> <span class="o">|</span> <span class="n">LinearOperator</span><span class="p">,</span>
|
|
<a id="__codelineno-0-3" name="__codelineno-0-3" href="#api-eigensolvers-__codelineno-0-3"></a> <span class="n">guess_vector</span><span class="p">:</span> <span class="n">NDArray</span><span class="p">[</span><span class="n">complex128</span><span class="p">],</span>
|
|
<a id="__codelineno-0-4" name="__codelineno-0-4" href="#api-eigensolvers-__codelineno-0-4"></a> <span class="n">iterations</span><span class="p">:</span> <span class="nb">int</span> <span class="o">=</span> <span class="mi">40</span><span class="p">,</span>
|
|
<a id="__codelineno-0-5" name="__codelineno-0-5" href="#api-eigensolvers-__codelineno-0-5"></a> <span class="n">tolerance</span><span class="p">:</span> <span class="nb">float</span> <span class="o">=</span> <span class="mf">1e-13</span><span class="p">,</span>
|
|
<a id="__codelineno-0-6" name="__codelineno-0-6" href="#api-eigensolvers-__codelineno-0-6"></a> <span class="n">solver</span><span class="p">:</span> <span class="n">Callable</span><span class="p">[</span><span class="o">...</span><span class="p">,</span> <span class="n">NDArray</span><span class="p">[</span><span class="n">complex128</span><span class="p">]]</span>
|
|
<a id="__codelineno-0-7" name="__codelineno-0-7" href="#api-eigensolvers-__codelineno-0-7"></a> <span class="o">|</span> <span class="kc">None</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
|
|
<a id="__codelineno-0-8" name="__codelineno-0-8" href="#api-eigensolvers-__codelineno-0-8"></a><span class="p">)</span> <span class="o">-></span> <span class="nb">tuple</span><span class="p">[</span><span class="nb">complex</span><span class="p">,</span> <span class="n">NDArray</span><span class="p">[</span><span class="n">numpy</span><span class="o">.</span><span class="n">complex128</span><span class="p">]]</span>
|
|
</code></pre></div>
|
|
|
|
<div class="doc doc-contents ">
|
|
|
|
<p>Use Rayleigh quotient iteration to refine an eigenvector guess.</p>
|
|
|
|
|
|
<p><span class="doc-section-title">Parameters:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
<th>Default</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>operator</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title="scipy.sparse.spmatrix" href="#scipy.sparse.spmatrix">spmatrix</a> | <a class="autorefs autorefs-internal" title="scipy.sparse.linalg.LinearOperator" href="#scipy.sparse.linalg.LinearOperator">LinearOperator</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Matrix to analyze.</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>guess_vector</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title="numpy.typing.NDArray" href="#numpy.typing.NDArray">NDArray</a>[<a class="autorefs autorefs-internal" title="numpy.complex128" href="#numpy.complex128">complex128</a>]</code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Eigenvector to refine.</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>iterations</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#index-recommended-starting-points">int</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Maximum number of iterations to perform. Default 40.</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<code>40</code>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>tolerance</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#float">float</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Stop iteration if <code>(A - I*eigenvalue) @ v < num_vectors * tolerance</code>,
|
|
Default 1e-13.</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<code>1e-13</code>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>solver</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title="collections.abc.Callable" href="#collections.abc.Callable">Callable</a>[..., <a class="autorefs autorefs-internal" title="numpy.typing.NDArray" href="#numpy.typing.NDArray">NDArray</a>[<a class="autorefs autorefs-internal" title="numpy.complex128" href="#numpy.complex128">complex128</a>]] | None</code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Solver function of the form <code>x = solver(A, b)</code>.
|
|
By default, use scipy.sparse.spsolve for sparse matrices and
|
|
scipy.sparse.bicgstab for general LinearOperator instances.</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<code>None</code>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
<p><span class="doc-section-title">Returns:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#tuple">tuple</a>[<a class="autorefs autorefs-internal" href="#complex">complex</a>, <a class="autorefs autorefs-internal" title="numpy.typing.NDArray" href="#numpy.typing.NDArray">NDArray</a>[<a class="autorefs autorefs-internal" title="numpy.complex128" href="#numpy.complex128">complex128</a>]]</code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>(eigenvalues, eigenvectors)</p>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="doc doc-object doc-function">
|
|
|
|
|
|
<h3 id="api-eigensolvers-meanas.eigensolvers.signed_eigensolve" class="doc doc-heading">
|
|
<code class="doc-symbol doc-symbol-heading doc-symbol-function"></code> <span class="doc doc-object-name doc-function-name">signed_eigensolve</span>
|
|
|
|
|
|
<a href="#api-eigensolvers-meanas.eigensolvers.signed_eigensolve" class="headerlink" title="Permanent link">¶</a></h3>
|
|
<div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#api-eigensolvers-__codelineno-0-1"></a><span class="nf">signed_eigensolve</span><span class="p">(</span>
|
|
<a id="__codelineno-0-2" name="__codelineno-0-2" href="#api-eigensolvers-__codelineno-0-2"></a> <span class="n">operator</span><span class="p">:</span> <span class="n">spmatrix</span> <span class="o">|</span> <span class="n">LinearOperator</span><span class="p">,</span>
|
|
<a id="__codelineno-0-3" name="__codelineno-0-3" href="#api-eigensolvers-__codelineno-0-3"></a> <span class="n">how_many</span><span class="p">:</span> <span class="nb">int</span><span class="p">,</span>
|
|
<a id="__codelineno-0-4" name="__codelineno-0-4" href="#api-eigensolvers-__codelineno-0-4"></a> <span class="n">negative</span><span class="p">:</span> <span class="nb">bool</span> <span class="o">=</span> <span class="kc">False</span><span class="p">,</span>
|
|
<a id="__codelineno-0-5" name="__codelineno-0-5" href="#api-eigensolvers-__codelineno-0-5"></a><span class="p">)</span> <span class="o">-></span> <span class="nb">tuple</span><span class="p">[</span>
|
|
<a id="__codelineno-0-6" name="__codelineno-0-6" href="#api-eigensolvers-__codelineno-0-6"></a> <span class="n">NDArray</span><span class="p">[</span><span class="n">numpy</span><span class="o">.</span><span class="n">complex128</span><span class="p">],</span> <span class="n">NDArray</span><span class="p">[</span><span class="n">numpy</span><span class="o">.</span><span class="n">complex128</span><span class="p">]</span>
|
|
<a id="__codelineno-0-7" name="__codelineno-0-7" href="#api-eigensolvers-__codelineno-0-7"></a><span class="p">]</span>
|
|
</code></pre></div>
|
|
|
|
<div class="doc doc-contents ">
|
|
|
|
<p>Find the largest-magnitude positive-only (or negative-only) eigenvalues and
|
|
eigenvectors of the provided matrix.</p>
|
|
|
|
|
|
<p><span class="doc-section-title">Parameters:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
<th>Default</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>operator</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title="scipy.sparse.spmatrix" href="#scipy.sparse.spmatrix">spmatrix</a> | <a class="autorefs autorefs-internal" title="scipy.sparse.linalg.LinearOperator" href="#scipy.sparse.linalg.LinearOperator">LinearOperator</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Matrix to analyze.</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>how_many</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#index-recommended-starting-points">int</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>How many eigenvalues to find.</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>negative</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#bool">bool</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Whether to find negative-only eigenvalues.
|
|
Default False (positive only).</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<code>False</code>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
<p><span class="doc-section-title">Returns:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title="numpy.typing.NDArray" href="#numpy.typing.NDArray">NDArray</a>[<a class="autorefs autorefs-internal" title="numpy.complex128" href="#numpy.complex128">complex128</a>]</code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>(sorted list of eigenvalues, 2D ndarray of corresponding eigenvectors)</p>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title="numpy.typing.NDArray" href="#numpy.typing.NDArray">NDArray</a>[<a class="autorefs autorefs-internal" title="numpy.complex128" href="#numpy.complex128">complex128</a>]</code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p><code>eigenvectors[:, k]</code> corresponds to the k-th eigenvalue</p>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div></section><section class="print-page" id="api-fdfd" heading-number="2.4"><h1 id="api-fdfd-fdfd">fdfd<a class="headerlink" href="#api-fdfd-fdfd" title="Permanent link">¶</a></h1>
|
|
|
|
|
|
<div class="doc doc-object doc-module">
|
|
|
|
|
|
|
|
<h2 id="api-fdfd-meanas.fdfd" class="doc doc-heading">
|
|
<code class="doc-symbol doc-symbol-heading doc-symbol-module"></code> <span class="doc doc-object-name doc-module-name">meanas.fdfd</span>
|
|
|
|
|
|
<a href="#api-fdfd-meanas.fdfd" class="headerlink" title="Permanent link">¶</a></h2>
|
|
|
|
<div class="doc doc-contents first">
|
|
|
|
<p>Tools for finite difference frequency-domain (FDFD) simulations and calculations.</p>
|
|
<p>These mostly involve picking a single frequency, then setting up and solving a
|
|
matrix equation (Ax=b) or eigenvalue problem.</p>
|
|
<p>Submodules:</p>
|
|
<ul>
|
|
<li><code>operators</code>, <code>functional</code>: General FDFD problem setup.</li>
|
|
<li><code>solvers</code>: Solver interface and reference implementation.</li>
|
|
<li><code>scpml</code>: Stretched-coordinate perfectly matched layer (SCPML) boundary conditions.</li>
|
|
<li><code>waveguide_2d</code>: Operators and mode-solver for waveguides with constant cross-section.</li>
|
|
<li><code>waveguide_3d</code>: Functions for transforming <code>waveguide_2d</code> results into 3D,
|
|
including mode-source and overlap-window construction.</li>
|
|
<li><code>farfield</code>, <code>bloch</code>, <code>eme</code>: specialized helper modules for near/far transforms,
|
|
Bloch-periodic problems, and eigenmode expansion.</li>
|
|
</ul>
|
|
<p>================================================================</p>
|
|
<p>From the "Frequency domain" section of <code>meanas.fdmath</code>, we have</p>
|
|
<div class="arithmatex">\[
|
|
\begin{aligned}
|
|
\tilde{E}_{l, \vec{r}} &= \tilde{E}_{\vec{r}} e^{-\imath \omega l \Delta_t} \\
|
|
\tilde{H}_{l - \frac{1}{2}, \vec{r} + \frac{1}{2}} &= \tilde{H}_{\vec{r} + \frac{1}{2}} e^{-\imath \omega (l - \frac{1}{2}) \Delta_t} \\
|
|
\tilde{J}_{l, \vec{r}} &= \tilde{J}_{\vec{r}} e^{-\imath \omega (l - \frac{1}{2}) \Delta_t} \\
|
|
\tilde{M}_{l - \frac{1}{2}, \vec{r} + \frac{1}{2}} &= \tilde{M}_{\vec{r} + \frac{1}{2}} e^{-\imath \omega l \Delta_t} \\
|
|
\hat{\nabla} \times (\mu^{-1}_{\vec{r} + \frac{1}{2}} \cdot \tilde{\nabla} \times \tilde{E}_{\vec{r}})
|
|
-\Omega^2 \epsilon_{\vec{r}} \cdot \tilde{E}_{\vec{r}} &= -\imath \Omega \tilde{J}_{\vec{r}} e^{\imath \omega \Delta_t / 2} \\
|
|
\Omega &= 2 \sin(\omega \Delta_t / 2) / \Delta_t
|
|
\end{aligned}
|
|
\]</div>
|
|
<p>resulting in</p>
|
|
<div class="arithmatex">\[
|
|
\begin{aligned}
|
|
\tilde{\partial}_t &\Rightarrow -\imath \Omega e^{-\imath \omega \Delta_t / 2}\\
|
|
\hat{\partial}_t &\Rightarrow -\imath \Omega e^{ \imath \omega \Delta_t / 2}\\
|
|
\end{aligned}
|
|
\]</div>
|
|
<p>Maxwell's equations are then</p>
|
|
<div class="arithmatex">\[
|
|
\begin{aligned}
|
|
\tilde{\nabla} \times \tilde{E}_{\vec{r}} &=
|
|
\imath \Omega e^{-\imath \omega \Delta_t / 2} \hat{B}_{\vec{r} + \frac{1}{2}}
|
|
- \hat{M}_{\vec{r} + \frac{1}{2}} \\
|
|
\hat{\nabla} \times \hat{H}_{\vec{r} + \frac{1}{2}} &=
|
|
-\imath \Omega e^{ \imath \omega \Delta_t / 2} \tilde{D}_{\vec{r}}
|
|
+ \tilde{J}_{\vec{r}} \\
|
|
\tilde{\nabla} \cdot \hat{B}_{\vec{r} + \frac{1}{2}} &= 0 \\
|
|
\hat{\nabla} \cdot \tilde{D}_{\vec{r}} &= \rho_{\vec{r}}
|
|
\end{aligned}
|
|
\]</div>
|
|
<p>With <span class="arithmatex">\(\Delta_t \to 0\)</span>, this simplifies to</p>
|
|
<div class="arithmatex">\[
|
|
\begin{aligned}
|
|
\tilde{E}_{l, \vec{r}} &\to \tilde{E}_{\vec{r}} \\
|
|
\tilde{H}_{l - \frac{1}{2}, \vec{r} + \frac{1}{2}} &\to \tilde{H}_{\vec{r} + \frac{1}{2}} \\
|
|
\tilde{J}_{l, \vec{r}} &\to \tilde{J}_{\vec{r}} \\
|
|
\tilde{M}_{l - \frac{1}{2}, \vec{r} + \frac{1}{2}} &\to \tilde{M}_{\vec{r} + \frac{1}{2}} \\
|
|
\Omega &\to \omega \\
|
|
\tilde{\partial}_t &\to -\imath \omega \\
|
|
\hat{\partial}_t &\to -\imath \omega \\
|
|
\end{aligned}
|
|
\]</div>
|
|
<p>and then</p>
|
|
<div class="arithmatex">\[
|
|
\begin{aligned}
|
|
\tilde{\nabla} \times \tilde{E}_{\vec{r}} &=
|
|
\imath \omega \hat{B}_{\vec{r} + \frac{1}{2}}
|
|
- \hat{M}_{\vec{r} + \frac{1}{2}} \\
|
|
\hat{\nabla} \times \hat{H}_{\vec{r} + \frac{1}{2}} &=
|
|
-\imath \omega \tilde{D}_{\vec{r}}
|
|
+ \tilde{J}_{\vec{r}} \\
|
|
\end{aligned}
|
|
\]</div>
|
|
<div class="arithmatex">\[
|
|
\hat{\nabla} \times (\mu^{-1}_{\vec{r} + \frac{1}{2}} \cdot \tilde{\nabla} \times \tilde{E}_{\vec{r}})
|
|
-\omega^2 \epsilon_{\vec{r}} \cdot \tilde{E}_{\vec{r}} = -\imath \omega \tilde{J}_{\vec{r}} \\
|
|
\]</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="doc doc-children">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div><h2 id="core-operator-layers">Core operator layers<a class="headerlink" href="#api-fdfd-core-operator-layers" title="Permanent link">¶</a></h2>
|
|
|
|
|
|
<div class="doc doc-object doc-module">
|
|
|
|
|
|
|
|
<h2 id="api-fdfd-meanas.fdfd.functional" class="doc doc-heading">
|
|
<code class="doc-symbol doc-symbol-heading doc-symbol-module"></code> <span class="doc doc-object-name doc-module-name">meanas.fdfd.functional</span>
|
|
|
|
|
|
<a href="#api-fdfd-meanas.fdfd.functional" class="headerlink" title="Permanent link">¶</a></h2>
|
|
|
|
<div class="doc doc-contents first">
|
|
|
|
<p>Functional versions of many FDFD operators. These can be useful for performing
|
|
FDFD calculations without needing to construct large matrices in memory.</p>
|
|
<p>The functions generated here expect <code>cfdfield_t</code> inputs with shape (3, X, Y, Z),
|
|
e.g. E = [E_x, E_y, E_z] where each (complex) component has shape (X, Y, Z)</p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="doc doc-children">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="doc doc-object doc-function">
|
|
|
|
|
|
<h3 id="api-fdfd-meanas.fdfd.functional.e_full" class="doc doc-heading">
|
|
<code class="doc-symbol doc-symbol-heading doc-symbol-function"></code> <span class="doc doc-object-name doc-function-name">e_full</span>
|
|
|
|
|
|
<a href="#api-fdfd-meanas.fdfd.functional.e_full" class="headerlink" title="Permanent link">¶</a></h3>
|
|
<div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#api-fdfd-__codelineno-0-1"></a><span class="nf">e_full</span><span class="p">(</span>
|
|
<a id="__codelineno-0-2" name="__codelineno-0-2" href="#api-fdfd-__codelineno-0-2"></a> <span class="n">omega</span><span class="p">:</span> <span class="nb">complex</span><span class="p">,</span>
|
|
<a id="__codelineno-0-3" name="__codelineno-0-3" href="#api-fdfd-__codelineno-0-3"></a> <span class="n">dxes</span><span class="p">:</span> <span class="n">dx_lists_t</span><span class="p">,</span>
|
|
<a id="__codelineno-0-4" name="__codelineno-0-4" href="#api-fdfd-__codelineno-0-4"></a> <span class="n">epsilon</span><span class="p">:</span> <span class="n">fdfield</span><span class="p">,</span>
|
|
<a id="__codelineno-0-5" name="__codelineno-0-5" href="#api-fdfd-__codelineno-0-5"></a> <span class="n">mu</span><span class="p">:</span> <span class="n">fdfield</span> <span class="o">|</span> <span class="kc">None</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
|
|
<a id="__codelineno-0-6" name="__codelineno-0-6" href="#api-fdfd-__codelineno-0-6"></a><span class="p">)</span> <span class="o">-></span> <span class="n">cfdfield_updater_t</span>
|
|
</code></pre></div>
|
|
|
|
<div class="doc doc-contents ">
|
|
|
|
<p>Wave operator for use with E-field. See <code>operators.e_full</code> for details.</p>
|
|
|
|
|
|
<p><span class="doc-section-title">Parameters:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
<th>Default</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>omega</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#complex">complex</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Angular frequency of the simulation</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>dxes</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" dx_lists_t
|
|
|
|
|
|
|
|
module-attribute
|
|
(meanas.fdmath.dx_lists_t)" href="#api-fdmath-meanas.fdmath.types.dx_lists_t">dx_lists_t</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Grid parameters <code>[dx_e, dx_h]</code> as described in <code>meanas.fdmath.types</code></p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>epsilon</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" fdfield (meanas.fdmath.fdfield)" href="#api-fdmath-meanas.fdmath.types.fdfield">fdfield</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Dielectric constant</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>mu</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" fdfield (meanas.fdmath.fdfield)" href="#api-fdmath-meanas.fdmath.types.fdfield">fdfield</a> | None</code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Magnetic permeability (default 1 everywhere)</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<code>None</code>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
<p><span class="doc-section-title">Returns:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" cfdfield_updater_t
|
|
|
|
|
|
|
|
module-attribute
|
|
(meanas.fdmath.cfdfield_updater_t)" href="#api-fdmath-meanas.fdmath.types.cfdfield_updater_t">cfdfield_updater_t</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Function <code>f</code> implementing the wave operator</p>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" cfdfield_updater_t
|
|
|
|
|
|
|
|
module-attribute
|
|
(meanas.fdmath.cfdfield_updater_t)" href="#api-fdmath-meanas.fdmath.types.cfdfield_updater_t">cfdfield_updater_t</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p><code>f(E)</code> -> <code>-i * omega * J</code></p>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="doc doc-object doc-function">
|
|
|
|
|
|
<h3 id="api-fdfd-meanas.fdfd.functional.eh_full" class="doc doc-heading">
|
|
<code class="doc-symbol doc-symbol-heading doc-symbol-function"></code> <span class="doc doc-object-name doc-function-name">eh_full</span>
|
|
|
|
|
|
<a href="#api-fdfd-meanas.fdfd.functional.eh_full" class="headerlink" title="Permanent link">¶</a></h3>
|
|
<div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#api-fdfd-__codelineno-0-1"></a><span class="nf">eh_full</span><span class="p">(</span>
|
|
<a id="__codelineno-0-2" name="__codelineno-0-2" href="#api-fdfd-__codelineno-0-2"></a> <span class="n">omega</span><span class="p">:</span> <span class="nb">complex</span><span class="p">,</span>
|
|
<a id="__codelineno-0-3" name="__codelineno-0-3" href="#api-fdfd-__codelineno-0-3"></a> <span class="n">dxes</span><span class="p">:</span> <span class="n">dx_lists_t</span><span class="p">,</span>
|
|
<a id="__codelineno-0-4" name="__codelineno-0-4" href="#api-fdfd-__codelineno-0-4"></a> <span class="n">epsilon</span><span class="p">:</span> <span class="n">fdfield</span><span class="p">,</span>
|
|
<a id="__codelineno-0-5" name="__codelineno-0-5" href="#api-fdfd-__codelineno-0-5"></a> <span class="n">mu</span><span class="p">:</span> <span class="n">fdfield</span> <span class="o">|</span> <span class="kc">None</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
|
|
<a id="__codelineno-0-6" name="__codelineno-0-6" href="#api-fdfd-__codelineno-0-6"></a><span class="p">)</span> <span class="o">-></span> <span class="n">Callable</span><span class="p">[</span>
|
|
<a id="__codelineno-0-7" name="__codelineno-0-7" href="#api-fdfd-__codelineno-0-7"></a> <span class="p">[</span><span class="n">cfdfield</span><span class="p">,</span> <span class="n">cfdfield</span><span class="p">],</span> <span class="nb">tuple</span><span class="p">[</span><span class="n">cfdfield_t</span><span class="p">,</span> <span class="n">cfdfield_t</span><span class="p">]</span>
|
|
<a id="__codelineno-0-8" name="__codelineno-0-8" href="#api-fdfd-__codelineno-0-8"></a><span class="p">]</span>
|
|
</code></pre></div>
|
|
|
|
<div class="doc doc-contents ">
|
|
|
|
<p>Wave operator for full (both E and H) field representation.
|
|
See <code>operators.eh_full</code>.</p>
|
|
|
|
|
|
<p><span class="doc-section-title">Parameters:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
<th>Default</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>omega</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#complex">complex</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Angular frequency of the simulation</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>dxes</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" dx_lists_t
|
|
|
|
|
|
|
|
module-attribute
|
|
(meanas.fdmath.dx_lists_t)" href="#api-fdmath-meanas.fdmath.types.dx_lists_t">dx_lists_t</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Grid parameters <code>[dx_e, dx_h]</code> as described in <code>meanas.fdmath.types</code></p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>epsilon</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" fdfield (meanas.fdmath.fdfield)" href="#api-fdmath-meanas.fdmath.types.fdfield">fdfield</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Dielectric constant</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>mu</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" fdfield (meanas.fdmath.fdfield)" href="#api-fdmath-meanas.fdmath.types.fdfield">fdfield</a> | None</code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Magnetic permeability (default 1 everywhere)</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<code>None</code>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
<p><span class="doc-section-title">Returns:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title="collections.abc.Callable" href="#collections.abc.Callable">Callable</a>[[<a class="autorefs autorefs-internal" title=" cfdfield (meanas.fdmath.cfdfield)" href="#api-fdmath-meanas.fdmath.types.cfdfield">cfdfield</a>, <a class="autorefs autorefs-internal" title=" cfdfield (meanas.fdmath.cfdfield)" href="#api-fdmath-meanas.fdmath.types.cfdfield">cfdfield</a>], <a class="autorefs autorefs-internal" href="#tuple">tuple</a>[<a class="autorefs autorefs-internal" title="meanas.fdmath.cfdfield_t" href="#meanas.fdmath.cfdfield_t">cfdfield_t</a>, <a class="autorefs autorefs-internal" title="meanas.fdmath.cfdfield_t" href="#meanas.fdmath.cfdfield_t">cfdfield_t</a>]]</code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Function <code>f</code> implementing the wave operator</p>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title="collections.abc.Callable" href="#collections.abc.Callable">Callable</a>[[<a class="autorefs autorefs-internal" title=" cfdfield (meanas.fdmath.cfdfield)" href="#api-fdmath-meanas.fdmath.types.cfdfield">cfdfield</a>, <a class="autorefs autorefs-internal" title=" cfdfield (meanas.fdmath.cfdfield)" href="#api-fdmath-meanas.fdmath.types.cfdfield">cfdfield</a>], <a class="autorefs autorefs-internal" href="#tuple">tuple</a>[<a class="autorefs autorefs-internal" title="meanas.fdmath.cfdfield_t" href="#meanas.fdmath.cfdfield_t">cfdfield_t</a>, <a class="autorefs autorefs-internal" title="meanas.fdmath.cfdfield_t" href="#meanas.fdmath.cfdfield_t">cfdfield_t</a>]]</code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p><code>f(E, H)</code> -> <code>(J, -M)</code></p>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="doc doc-object doc-function">
|
|
|
|
|
|
<h3 id="api-fdfd-meanas.fdfd.functional.e2h" class="doc doc-heading">
|
|
<code class="doc-symbol doc-symbol-heading doc-symbol-function"></code> <span class="doc doc-object-name doc-function-name">e2h</span>
|
|
|
|
|
|
<a href="#api-fdfd-meanas.fdfd.functional.e2h" class="headerlink" title="Permanent link">¶</a></h3>
|
|
<div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#api-fdfd-__codelineno-0-1"></a><span class="nf">e2h</span><span class="p">(</span>
|
|
<a id="__codelineno-0-2" name="__codelineno-0-2" href="#api-fdfd-__codelineno-0-2"></a> <span class="n">omega</span><span class="p">:</span> <span class="nb">complex</span><span class="p">,</span>
|
|
<a id="__codelineno-0-3" name="__codelineno-0-3" href="#api-fdfd-__codelineno-0-3"></a> <span class="n">dxes</span><span class="p">:</span> <span class="n">dx_lists_t</span><span class="p">,</span>
|
|
<a id="__codelineno-0-4" name="__codelineno-0-4" href="#api-fdfd-__codelineno-0-4"></a> <span class="n">mu</span><span class="p">:</span> <span class="n">fdfield</span> <span class="o">|</span> <span class="kc">None</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
|
|
<a id="__codelineno-0-5" name="__codelineno-0-5" href="#api-fdfd-__codelineno-0-5"></a><span class="p">)</span> <span class="o">-></span> <span class="n">cfdfield_updater_t</span>
|
|
</code></pre></div>
|
|
|
|
<div class="doc doc-contents ">
|
|
|
|
<p>Utility operator for converting the <code>E</code> field into the <code>H</code> field.
|
|
For use with <code>e_full</code> -- assumes that there is no magnetic current <code>M</code>.</p>
|
|
|
|
|
|
<p><span class="doc-section-title">Parameters:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
<th>Default</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>omega</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#complex">complex</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Angular frequency of the simulation</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>dxes</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" dx_lists_t
|
|
|
|
|
|
|
|
module-attribute
|
|
(meanas.fdmath.dx_lists_t)" href="#api-fdmath-meanas.fdmath.types.dx_lists_t">dx_lists_t</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Grid parameters <code>[dx_e, dx_h]</code> as described in <code>meanas.fdmath.types</code></p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>mu</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" fdfield (meanas.fdmath.fdfield)" href="#api-fdmath-meanas.fdmath.types.fdfield">fdfield</a> | None</code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Magnetic permeability (default 1 everywhere)</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<code>None</code>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
<p><span class="doc-section-title">Returns:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" cfdfield_updater_t
|
|
|
|
|
|
|
|
module-attribute
|
|
(meanas.fdmath.cfdfield_updater_t)" href="#api-fdmath-meanas.fdmath.types.cfdfield_updater_t">cfdfield_updater_t</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Function <code>f</code> for converting <code>E</code> to <code>H</code>,</p>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" cfdfield_updater_t
|
|
|
|
|
|
|
|
module-attribute
|
|
(meanas.fdmath.cfdfield_updater_t)" href="#api-fdmath-meanas.fdmath.types.cfdfield_updater_t">cfdfield_updater_t</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p><code>f(E)</code> -> <code>H</code></p>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="doc doc-object doc-function">
|
|
|
|
|
|
<h3 id="api-fdfd-meanas.fdfd.functional.m2j" class="doc doc-heading">
|
|
<code class="doc-symbol doc-symbol-heading doc-symbol-function"></code> <span class="doc doc-object-name doc-function-name">m2j</span>
|
|
|
|
|
|
<a href="#api-fdfd-meanas.fdfd.functional.m2j" class="headerlink" title="Permanent link">¶</a></h3>
|
|
<div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#api-fdfd-__codelineno-0-1"></a><span class="nf">m2j</span><span class="p">(</span>
|
|
<a id="__codelineno-0-2" name="__codelineno-0-2" href="#api-fdfd-__codelineno-0-2"></a> <span class="n">omega</span><span class="p">:</span> <span class="nb">complex</span><span class="p">,</span>
|
|
<a id="__codelineno-0-3" name="__codelineno-0-3" href="#api-fdfd-__codelineno-0-3"></a> <span class="n">dxes</span><span class="p">:</span> <span class="n">dx_lists_t</span><span class="p">,</span>
|
|
<a id="__codelineno-0-4" name="__codelineno-0-4" href="#api-fdfd-__codelineno-0-4"></a> <span class="n">mu</span><span class="p">:</span> <span class="n">fdfield</span> <span class="o">|</span> <span class="kc">None</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
|
|
<a id="__codelineno-0-5" name="__codelineno-0-5" href="#api-fdfd-__codelineno-0-5"></a><span class="p">)</span> <span class="o">-></span> <span class="n">cfdfield_updater_t</span>
|
|
</code></pre></div>
|
|
|
|
<div class="doc doc-contents ">
|
|
|
|
<p>Utility operator for converting magnetic current <code>M</code> distribution
|
|
into equivalent electric current distribution <code>J</code>.
|
|
For use with e.g. <code>e_full</code>.</p>
|
|
|
|
|
|
<p><span class="doc-section-title">Parameters:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
<th>Default</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>omega</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#complex">complex</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Angular frequency of the simulation</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>dxes</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" dx_lists_t
|
|
|
|
|
|
|
|
module-attribute
|
|
(meanas.fdmath.dx_lists_t)" href="#api-fdmath-meanas.fdmath.types.dx_lists_t">dx_lists_t</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Grid parameters <code>[dx_e, dx_h]</code> as described in <code>meanas.fdmath.types</code></p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>mu</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" fdfield (meanas.fdmath.fdfield)" href="#api-fdmath-meanas.fdmath.types.fdfield">fdfield</a> | None</code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Magnetic permeability (default 1 everywhere)</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<code>None</code>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
<p><span class="doc-section-title">Returns:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" cfdfield_updater_t
|
|
|
|
|
|
|
|
module-attribute
|
|
(meanas.fdmath.cfdfield_updater_t)" href="#api-fdmath-meanas.fdmath.types.cfdfield_updater_t">cfdfield_updater_t</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Function <code>f</code> for converting <code>M</code> to <code>J</code>,</p>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" cfdfield_updater_t
|
|
|
|
|
|
|
|
module-attribute
|
|
(meanas.fdmath.cfdfield_updater_t)" href="#api-fdmath-meanas.fdmath.types.cfdfield_updater_t">cfdfield_updater_t</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p><code>f(M)</code> -> <code>J</code></p>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="doc doc-object doc-function">
|
|
|
|
|
|
<h3 id="api-fdfd-meanas.fdfd.functional.e_tfsf_source" class="doc doc-heading">
|
|
<code class="doc-symbol doc-symbol-heading doc-symbol-function"></code> <span class="doc doc-object-name doc-function-name">e_tfsf_source</span>
|
|
|
|
|
|
<a href="#api-fdfd-meanas.fdfd.functional.e_tfsf_source" class="headerlink" title="Permanent link">¶</a></h3>
|
|
<div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#api-fdfd-__codelineno-0-1"></a><span class="nf">e_tfsf_source</span><span class="p">(</span>
|
|
<a id="__codelineno-0-2" name="__codelineno-0-2" href="#api-fdfd-__codelineno-0-2"></a> <span class="n">TF_region</span><span class="p">:</span> <span class="n">fdfield</span><span class="p">,</span>
|
|
<a id="__codelineno-0-3" name="__codelineno-0-3" href="#api-fdfd-__codelineno-0-3"></a> <span class="n">omega</span><span class="p">:</span> <span class="nb">complex</span><span class="p">,</span>
|
|
<a id="__codelineno-0-4" name="__codelineno-0-4" href="#api-fdfd-__codelineno-0-4"></a> <span class="n">dxes</span><span class="p">:</span> <span class="n">dx_lists_t</span><span class="p">,</span>
|
|
<a id="__codelineno-0-5" name="__codelineno-0-5" href="#api-fdfd-__codelineno-0-5"></a> <span class="n">epsilon</span><span class="p">:</span> <span class="n">fdfield</span><span class="p">,</span>
|
|
<a id="__codelineno-0-6" name="__codelineno-0-6" href="#api-fdfd-__codelineno-0-6"></a> <span class="n">mu</span><span class="p">:</span> <span class="n">fdfield</span> <span class="o">|</span> <span class="kc">None</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
|
|
<a id="__codelineno-0-7" name="__codelineno-0-7" href="#api-fdfd-__codelineno-0-7"></a><span class="p">)</span> <span class="o">-></span> <span class="n">cfdfield_updater_t</span>
|
|
</code></pre></div>
|
|
|
|
<div class="doc doc-contents ">
|
|
|
|
<p>Operator that turns an E-field distribution into a total-field/scattered-field
|
|
(TFSF) source.</p>
|
|
<p>If <code>A</code> is the full wave operator from <code>e_full(...)</code> and <code>Q</code> is the diagonal
|
|
mask selecting the total-field region, then the TFSF source is the commutator</p>
|
|
<div class="arithmatex">\[
|
|
\frac{A Q - Q A}{-i \omega} E.
|
|
\]</div>
|
|
<p>This vanishes in the interior of the total-field and scattered-field regions
|
|
and is supported only at their shared boundary, where the mask discontinuity
|
|
makes <code>A</code> and <code>Q</code> fail to commute. The returned current is therefore the
|
|
distributed source needed to inject the desired total field without also
|
|
forcing the scattered-field region.</p>
|
|
|
|
|
|
<p><span class="doc-section-title">Parameters:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
<th>Default</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>TF_region</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" fdfield (meanas.fdmath.fdfield)" href="#api-fdmath-meanas.fdmath.types.fdfield">fdfield</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>mask which is set to 1 in the total-field region, and 0 elsewhere
|
|
(i.e. in the scattered-field region).
|
|
Should have the same shape as the simulation grid, e.g. <code>epsilon[0].shape</code>.</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>omega</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#complex">complex</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Angular frequency of the simulation</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>dxes</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" dx_lists_t
|
|
|
|
|
|
|
|
module-attribute
|
|
(meanas.fdmath.dx_lists_t)" href="#api-fdmath-meanas.fdmath.types.dx_lists_t">dx_lists_t</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Grid parameters <code>[dx_e, dx_h]</code> as described in <code>meanas.fdmath.types</code></p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>epsilon</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" fdfield (meanas.fdmath.fdfield)" href="#api-fdmath-meanas.fdmath.types.fdfield">fdfield</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Dielectric constant distribution</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>mu</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" fdfield (meanas.fdmath.fdfield)" href="#api-fdmath-meanas.fdmath.types.fdfield">fdfield</a> | None</code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Magnetic permeability (default 1 everywhere)</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<code>None</code>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
<p><span class="doc-section-title">Returns:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" cfdfield_updater_t
|
|
|
|
|
|
|
|
module-attribute
|
|
(meanas.fdmath.cfdfield_updater_t)" href="#api-fdmath-meanas.fdmath.types.cfdfield_updater_t">cfdfield_updater_t</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Function <code>f</code> which takes an E field and returns a current distribution,</p>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" cfdfield_updater_t
|
|
|
|
|
|
|
|
module-attribute
|
|
(meanas.fdmath.cfdfield_updater_t)" href="#api-fdmath-meanas.fdmath.types.cfdfield_updater_t">cfdfield_updater_t</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p><code>f(E)</code> -> <code>J</code></p>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="doc doc-object doc-function">
|
|
|
|
|
|
<h3 id="api-fdfd-meanas.fdfd.functional.poynting_e_cross_h" class="doc doc-heading">
|
|
<code class="doc-symbol doc-symbol-heading doc-symbol-function"></code> <span class="doc doc-object-name doc-function-name">poynting_e_cross_h</span>
|
|
|
|
|
|
<a href="#api-fdfd-meanas.fdfd.functional.poynting_e_cross_h" class="headerlink" title="Permanent link">¶</a></h3>
|
|
<div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#api-fdfd-__codelineno-0-1"></a><span class="nf">poynting_e_cross_h</span><span class="p">(</span>
|
|
<a id="__codelineno-0-2" name="__codelineno-0-2" href="#api-fdfd-__codelineno-0-2"></a> <span class="n">dxes</span><span class="p">:</span> <span class="n">dx_lists_t</span><span class="p">,</span>
|
|
<a id="__codelineno-0-3" name="__codelineno-0-3" href="#api-fdfd-__codelineno-0-3"></a><span class="p">)</span> <span class="o">-></span> <span class="n">Callable</span><span class="p">[[</span><span class="n">cfdfield</span><span class="p">,</span> <span class="n">cfdfield</span><span class="p">],</span> <span class="n">cfdfield_t</span><span class="p">]</span>
|
|
</code></pre></div>
|
|
|
|
<div class="doc doc-contents ">
|
|
|
|
<p>Generates a function that takes the single-frequency <code>E</code> and <code>H</code> fields
|
|
and calculates the cross product <code>E</code> x <code>H</code> = <span class="arithmatex">\(E \times H\)</span> as required
|
|
for the Poynting vector, <span class="arithmatex">\(S = E \times H\)</span>.</p>
|
|
<p>On the Yee grid, the electric and magnetic components are not stored at the
|
|
same locations. This helper therefore applies the same one-cell electric-field
|
|
shifts used by the sparse <code>operators.poynting_e_cross(...)</code> construction so
|
|
that the discrete cross product matches the face-centered energy flux used in
|
|
<code>meanas.fdtd.energy.poynting(...)</code>.</p>
|
|
|
|
|
|
<details class="note" open>
|
|
<summary>Note</summary>
|
|
<p>This function also shifts the input <code>E</code> field by one cell as required
|
|
for computing the Poynting cross product (see <code>meanas.fdfd</code> module docs).</p>
|
|
</details>
|
|
|
|
<details class="note" open>
|
|
<summary>Note</summary>
|
|
<p>If <code>E</code> and <code>H</code> are peak amplitudes as assumed elsewhere in this code,
|
|
the time-average of the poynting vector is <code><S> = Re(S)/2 = Re(E x H*) / 2</code>.
|
|
The factor of <code>1/2</code> can be omitted if root-mean-square quantities are used
|
|
instead.</p>
|
|
</details>
|
|
|
|
<p><span class="doc-section-title">Parameters:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
<th>Default</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>dxes</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" dx_lists_t
|
|
|
|
|
|
|
|
module-attribute
|
|
(meanas.fdmath.dx_lists_t)" href="#api-fdmath-meanas.fdmath.types.dx_lists_t">dx_lists_t</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Grid parameters <code>[dx_e, dx_h]</code> as described in <code>meanas.fdmath.types</code></p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
<p><span class="doc-section-title">Returns:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title="collections.abc.Callable" href="#collections.abc.Callable">Callable</a>[[<a class="autorefs autorefs-internal" title=" cfdfield (meanas.fdmath.cfdfield)" href="#api-fdmath-meanas.fdmath.types.cfdfield">cfdfield</a>, <a class="autorefs autorefs-internal" title=" cfdfield (meanas.fdmath.cfdfield)" href="#api-fdmath-meanas.fdmath.types.cfdfield">cfdfield</a>], <a class="autorefs autorefs-internal" title="meanas.fdmath.cfdfield_t" href="#meanas.fdmath.cfdfield_t">cfdfield_t</a>]</code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Function <code>f</code> that returns the staggered-grid cross product <code>E \times H</code>.</p>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title="collections.abc.Callable" href="#collections.abc.Callable">Callable</a>[[<a class="autorefs autorefs-internal" title=" cfdfield (meanas.fdmath.cfdfield)" href="#api-fdmath-meanas.fdmath.types.cfdfield">cfdfield</a>, <a class="autorefs autorefs-internal" title=" cfdfield (meanas.fdmath.cfdfield)" href="#api-fdmath-meanas.fdmath.types.cfdfield">cfdfield</a>], <a class="autorefs autorefs-internal" title="meanas.fdmath.cfdfield_t" href="#meanas.fdmath.cfdfield_t">cfdfield_t</a>]</code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>For time-average power, call it as <code>f(E, H.conj())</code> and take <code>Re(...) / 2</code>.</p>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="doc doc-object doc-module">
|
|
|
|
|
|
|
|
<h2 id="api-fdfd-meanas.fdfd.operators" class="doc doc-heading">
|
|
<code class="doc-symbol doc-symbol-heading doc-symbol-module"></code> <span class="doc doc-object-name doc-module-name">meanas.fdfd.operators</span>
|
|
|
|
|
|
<a href="#api-fdfd-meanas.fdfd.operators" class="headerlink" title="Permanent link">¶</a></h2>
|
|
|
|
<div class="doc doc-contents first">
|
|
|
|
<p>Sparse matrix operators for use with electromagnetic wave equations.</p>
|
|
<p>These functions return sparse-matrix (<code>scipy.sparse.sparray</code>) representations of
|
|
a variety of operators, intended for use with E and H fields vectorized using the
|
|
<code>meanas.fdmath.vectorization.vec()</code> and <code>meanas.fdmath.vectorization.unvec()</code> functions.</p>
|
|
<p>E- and H-field values are defined on a Yee cell; <code>epsilon</code> values should be calculated for
|
|
cells centered at each E component (<code>mu</code> at each H component).</p>
|
|
<p>Many of these functions require a <code>dxes</code> parameter, of type <code>dx_lists_t</code>; see
|
|
the <code>meanas.fdmath.types</code> submodule for details.</p>
|
|
<p>The following operators are included:</p>
|
|
<ul>
|
|
<li>E-only wave operator</li>
|
|
<li>H-only wave operator</li>
|
|
<li>EH wave operator</li>
|
|
<li>Curl for use with E, H fields</li>
|
|
<li>E to H conversion</li>
|
|
<li>M to J conversion</li>
|
|
<li>Poynting cross products</li>
|
|
<li>Circular shifts</li>
|
|
<li>Discrete derivatives</li>
|
|
<li>Averaging operators</li>
|
|
<li>Cross product matrices</li>
|
|
</ul>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="doc doc-children">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="doc doc-object doc-function">
|
|
|
|
|
|
<h3 id="api-fdfd-meanas.fdfd.operators.e_full" class="doc doc-heading">
|
|
<code class="doc-symbol doc-symbol-heading doc-symbol-function"></code> <span class="doc doc-object-name doc-function-name">e_full</span>
|
|
|
|
|
|
<a href="#api-fdfd-meanas.fdfd.operators.e_full" class="headerlink" title="Permanent link">¶</a></h3>
|
|
<div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#api-fdfd-__codelineno-0-1"></a><span class="nf">e_full</span><span class="p">(</span>
|
|
<a id="__codelineno-0-2" name="__codelineno-0-2" href="#api-fdfd-__codelineno-0-2"></a> <span class="n">omega</span><span class="p">:</span> <span class="nb">complex</span><span class="p">,</span>
|
|
<a id="__codelineno-0-3" name="__codelineno-0-3" href="#api-fdfd-__codelineno-0-3"></a> <span class="n">dxes</span><span class="p">:</span> <span class="n">dx_lists_t</span><span class="p">,</span>
|
|
<a id="__codelineno-0-4" name="__codelineno-0-4" href="#api-fdfd-__codelineno-0-4"></a> <span class="n">epsilon</span><span class="p">:</span> <span class="n">vfdfield</span> <span class="o">|</span> <span class="n">vcfdfield</span><span class="p">,</span>
|
|
<a id="__codelineno-0-5" name="__codelineno-0-5" href="#api-fdfd-__codelineno-0-5"></a> <span class="n">mu</span><span class="p">:</span> <span class="n">vfdfield</span> <span class="o">|</span> <span class="kc">None</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
|
|
<a id="__codelineno-0-6" name="__codelineno-0-6" href="#api-fdfd-__codelineno-0-6"></a> <span class="n">pec</span><span class="p">:</span> <span class="n">vfdfield</span> <span class="o">|</span> <span class="kc">None</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
|
|
<a id="__codelineno-0-7" name="__codelineno-0-7" href="#api-fdfd-__codelineno-0-7"></a> <span class="n">pmc</span><span class="p">:</span> <span class="n">vfdfield</span> <span class="o">|</span> <span class="kc">None</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
|
|
<a id="__codelineno-0-8" name="__codelineno-0-8" href="#api-fdfd-__codelineno-0-8"></a><span class="p">)</span> <span class="o">-></span> <span class="n">sparse</span><span class="o">.</span><span class="n">sparray</span>
|
|
</code></pre></div>
|
|
|
|
<div class="doc doc-contents ">
|
|
|
|
<p>Wave operator
|
|
$$ \nabla \times (\frac{1}{\mu} \nabla \times) - \Omega^2 \epsilon $$</p>
|
|
<div class="highlight"><pre><span></span><code>del x (1/mu * del x) - omega**2 * epsilon
|
|
</code></pre></div>
|
|
<p>for use with the E-field, with wave equation
|
|
$$ (\nabla \times (\frac{1}{\mu} \nabla \times) - \Omega^2 \epsilon) E = -\imath \omega J $$</p>
|
|
<div class="highlight"><pre><span></span><code>(del x (1/mu * del x) - omega**2 * epsilon) E = -i * omega * J
|
|
</code></pre></div>
|
|
<p>To make this matrix symmetric, use the preconditioners from <code>e_full_preconditioners()</code>.</p>
|
|
|
|
|
|
<p><span class="doc-section-title">Parameters:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
<th>Default</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>omega</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#complex">complex</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Angular frequency of the simulation</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>dxes</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" dx_lists_t
|
|
|
|
|
|
|
|
module-attribute
|
|
(meanas.fdmath.dx_lists_t)" href="#api-fdmath-meanas.fdmath.types.dx_lists_t">dx_lists_t</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Grid parameters <code>[dx_e, dx_h]</code> as described in <code>meanas.fdmath.types</code></p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>epsilon</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" vfdfield (meanas.fdmath.vfdfield)" href="#api-fdmath-meanas.fdmath.types.vfdfield2">vfdfield</a> | <a class="autorefs autorefs-internal" title=" vcfdfield (meanas.fdmath.vcfdfield)" href="#api-fdmath-meanas.fdmath.types.vcfdfield">vcfdfield</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Vectorized dielectric constant</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>mu</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" vfdfield (meanas.fdmath.vfdfield)" href="#api-fdmath-meanas.fdmath.types.vfdfield2">vfdfield</a> | None</code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Vectorized magnetic permeability (default 1 everywhere).</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<code>None</code>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>pec</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" vfdfield (meanas.fdmath.vfdfield)" href="#api-fdmath-meanas.fdmath.types.vfdfield2">vfdfield</a> | None</code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Vectorized mask specifying PEC cells. Any cells where <code>pec != 0</code> are interpreted
|
|
as containing a perfect electrical conductor (PEC).
|
|
The PEC is applied per-field-component (i.e. <code>pec.size == epsilon.size</code>)</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<code>None</code>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>pmc</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" vfdfield (meanas.fdmath.vfdfield)" href="#api-fdmath-meanas.fdmath.types.vfdfield2">vfdfield</a> | None</code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Vectorized mask specifying PMC cells. Any cells where <code>pmc != 0</code> are interpreted
|
|
as containing a perfect magnetic conductor (PMC).
|
|
The PMC is applied per-field-component (i.e. <code>pmc.size == epsilon.size</code>)</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<code>None</code>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
<p><span class="doc-section-title">Returns:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title="scipy.sparse.sparray" href="#scipy.sparse.sparray">sparray</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Sparse matrix containing the wave operator.</p>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="doc doc-object doc-function">
|
|
|
|
|
|
<h3 id="api-fdfd-meanas.fdfd.operators.e_full_preconditioners" class="doc doc-heading">
|
|
<code class="doc-symbol doc-symbol-heading doc-symbol-function"></code> <span class="doc doc-object-name doc-function-name">e_full_preconditioners</span>
|
|
|
|
|
|
<a href="#api-fdfd-meanas.fdfd.operators.e_full_preconditioners" class="headerlink" title="Permanent link">¶</a></h3>
|
|
<div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#api-fdfd-__codelineno-0-1"></a><span class="nf">e_full_preconditioners</span><span class="p">(</span>
|
|
<a id="__codelineno-0-2" name="__codelineno-0-2" href="#api-fdfd-__codelineno-0-2"></a> <span class="n">dxes</span><span class="p">:</span> <span class="n">dx_lists_t</span><span class="p">,</span>
|
|
<a id="__codelineno-0-3" name="__codelineno-0-3" href="#api-fdfd-__codelineno-0-3"></a><span class="p">)</span> <span class="o">-></span> <span class="nb">tuple</span><span class="p">[</span><span class="n">sparse</span><span class="o">.</span><span class="n">sparray</span><span class="p">,</span> <span class="n">sparse</span><span class="o">.</span><span class="n">sparray</span><span class="p">]</span>
|
|
</code></pre></div>
|
|
|
|
<div class="doc doc-contents ">
|
|
|
|
<p>Left and right preconditioners <code>(Pl, Pr)</code> for symmetrizing the <code>e_full</code> wave operator.</p>
|
|
<p>The preconditioned matrix <code>A_symm = (Pl @ A @ Pr)</code> is complex-symmetric
|
|
(non-Hermitian unless there is no loss or PMLs).</p>
|
|
<p>The preconditioner matrices are diagonal and complex, with <code>Pr = 1 / Pl</code></p>
|
|
|
|
|
|
<p><span class="doc-section-title">Parameters:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
<th>Default</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>dxes</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" dx_lists_t
|
|
|
|
|
|
|
|
module-attribute
|
|
(meanas.fdmath.dx_lists_t)" href="#api-fdmath-meanas.fdmath.types.dx_lists_t">dx_lists_t</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Grid parameters <code>[dx_e, dx_h]</code> as described in <code>meanas.fdmath.types</code></p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
<p><span class="doc-section-title">Returns:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#tuple">tuple</a>[<a class="autorefs autorefs-internal" title="scipy.sparse.sparray" href="#scipy.sparse.sparray">sparray</a>, <a class="autorefs autorefs-internal" title="scipy.sparse.sparray" href="#scipy.sparse.sparray">sparray</a>]</code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Preconditioner matrices <code>(Pl, Pr)</code>.</p>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="doc doc-object doc-function">
|
|
|
|
|
|
<h3 id="api-fdfd-meanas.fdfd.operators.h_full" class="doc doc-heading">
|
|
<code class="doc-symbol doc-symbol-heading doc-symbol-function"></code> <span class="doc doc-object-name doc-function-name">h_full</span>
|
|
|
|
|
|
<a href="#api-fdfd-meanas.fdfd.operators.h_full" class="headerlink" title="Permanent link">¶</a></h3>
|
|
<div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#api-fdfd-__codelineno-0-1"></a><span class="nf">h_full</span><span class="p">(</span>
|
|
<a id="__codelineno-0-2" name="__codelineno-0-2" href="#api-fdfd-__codelineno-0-2"></a> <span class="n">omega</span><span class="p">:</span> <span class="nb">complex</span><span class="p">,</span>
|
|
<a id="__codelineno-0-3" name="__codelineno-0-3" href="#api-fdfd-__codelineno-0-3"></a> <span class="n">dxes</span><span class="p">:</span> <span class="n">dx_lists_t</span><span class="p">,</span>
|
|
<a id="__codelineno-0-4" name="__codelineno-0-4" href="#api-fdfd-__codelineno-0-4"></a> <span class="n">epsilon</span><span class="p">:</span> <span class="n">vfdfield</span><span class="p">,</span>
|
|
<a id="__codelineno-0-5" name="__codelineno-0-5" href="#api-fdfd-__codelineno-0-5"></a> <span class="n">mu</span><span class="p">:</span> <span class="n">vfdfield</span> <span class="o">|</span> <span class="kc">None</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
|
|
<a id="__codelineno-0-6" name="__codelineno-0-6" href="#api-fdfd-__codelineno-0-6"></a> <span class="n">pec</span><span class="p">:</span> <span class="n">vfdfield</span> <span class="o">|</span> <span class="kc">None</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
|
|
<a id="__codelineno-0-7" name="__codelineno-0-7" href="#api-fdfd-__codelineno-0-7"></a> <span class="n">pmc</span><span class="p">:</span> <span class="n">vfdfield</span> <span class="o">|</span> <span class="kc">None</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
|
|
<a id="__codelineno-0-8" name="__codelineno-0-8" href="#api-fdfd-__codelineno-0-8"></a><span class="p">)</span> <span class="o">-></span> <span class="n">sparse</span><span class="o">.</span><span class="n">sparray</span>
|
|
</code></pre></div>
|
|
|
|
<div class="doc doc-contents ">
|
|
|
|
<p>Wave operator
|
|
$$ \nabla \times (\frac{1}{\epsilon} \nabla \times) - \omega^2 \mu $$</p>
|
|
<div class="highlight"><pre><span></span><code>del x (1/epsilon * del x) - omega**2 * mu
|
|
</code></pre></div>
|
|
<p>for use with the H-field, with wave equation
|
|
$$ (\nabla \times (\frac{1}{\epsilon} \nabla \times) - \omega^2 \mu) E = \imath \omega M $$</p>
|
|
<div class="highlight"><pre><span></span><code>(del x (1/epsilon * del x) - omega**2 * mu) E = i * omega * M
|
|
</code></pre></div>
|
|
|
|
|
|
<p><span class="doc-section-title">Parameters:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
<th>Default</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>omega</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#complex">complex</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Angular frequency of the simulation</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>dxes</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" dx_lists_t
|
|
|
|
|
|
|
|
module-attribute
|
|
(meanas.fdmath.dx_lists_t)" href="#api-fdmath-meanas.fdmath.types.dx_lists_t">dx_lists_t</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Grid parameters <code>[dx_e, dx_h]</code> as described in <code>meanas.fdmath.types</code></p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>epsilon</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" vfdfield (meanas.fdmath.vfdfield)" href="#api-fdmath-meanas.fdmath.types.vfdfield2">vfdfield</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Vectorized dielectric constant</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>mu</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" vfdfield (meanas.fdmath.vfdfield)" href="#api-fdmath-meanas.fdmath.types.vfdfield2">vfdfield</a> | None</code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Vectorized magnetic permeability (default 1 everywhere)</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<code>None</code>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>pec</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" vfdfield (meanas.fdmath.vfdfield)" href="#api-fdmath-meanas.fdmath.types.vfdfield2">vfdfield</a> | None</code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Vectorized mask specifying PEC cells. Any cells where <code>pec != 0</code> are interpreted
|
|
as containing a perfect electrical conductor (PEC).
|
|
The PEC is applied per-field-component (i.e. <code>pec.size == epsilon.size</code>)</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<code>None</code>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>pmc</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" vfdfield (meanas.fdmath.vfdfield)" href="#api-fdmath-meanas.fdmath.types.vfdfield2">vfdfield</a> | None</code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Vectorized mask specifying PMC cells. Any cells where <code>pmc != 0</code> are interpreted
|
|
as containing a perfect magnetic conductor (PMC).
|
|
The PMC is applied per-field-component (i.e. <code>pmc.size == epsilon.size</code>)</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<code>None</code>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
<p><span class="doc-section-title">Returns:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title="scipy.sparse.sparray" href="#scipy.sparse.sparray">sparray</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Sparse matrix containing the wave operator.</p>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="doc doc-object doc-function">
|
|
|
|
|
|
<h3 id="api-fdfd-meanas.fdfd.operators.eh_full" class="doc doc-heading">
|
|
<code class="doc-symbol doc-symbol-heading doc-symbol-function"></code> <span class="doc doc-object-name doc-function-name">eh_full</span>
|
|
|
|
|
|
<a href="#api-fdfd-meanas.fdfd.operators.eh_full" class="headerlink" title="Permanent link">¶</a></h3>
|
|
<div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#api-fdfd-__codelineno-0-1"></a><span class="nf">eh_full</span><span class="p">(</span>
|
|
<a id="__codelineno-0-2" name="__codelineno-0-2" href="#api-fdfd-__codelineno-0-2"></a> <span class="n">omega</span><span class="p">:</span> <span class="nb">complex</span><span class="p">,</span>
|
|
<a id="__codelineno-0-3" name="__codelineno-0-3" href="#api-fdfd-__codelineno-0-3"></a> <span class="n">dxes</span><span class="p">:</span> <span class="n">dx_lists_t</span><span class="p">,</span>
|
|
<a id="__codelineno-0-4" name="__codelineno-0-4" href="#api-fdfd-__codelineno-0-4"></a> <span class="n">epsilon</span><span class="p">:</span> <span class="n">vfdfield</span><span class="p">,</span>
|
|
<a id="__codelineno-0-5" name="__codelineno-0-5" href="#api-fdfd-__codelineno-0-5"></a> <span class="n">mu</span><span class="p">:</span> <span class="n">vfdfield</span> <span class="o">|</span> <span class="kc">None</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
|
|
<a id="__codelineno-0-6" name="__codelineno-0-6" href="#api-fdfd-__codelineno-0-6"></a> <span class="n">pec</span><span class="p">:</span> <span class="n">vfdfield</span> <span class="o">|</span> <span class="kc">None</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
|
|
<a id="__codelineno-0-7" name="__codelineno-0-7" href="#api-fdfd-__codelineno-0-7"></a> <span class="n">pmc</span><span class="p">:</span> <span class="n">vfdfield</span> <span class="o">|</span> <span class="kc">None</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
|
|
<a id="__codelineno-0-8" name="__codelineno-0-8" href="#api-fdfd-__codelineno-0-8"></a><span class="p">)</span> <span class="o">-></span> <span class="n">sparse</span><span class="o">.</span><span class="n">sparray</span>
|
|
</code></pre></div>
|
|
|
|
<div class="doc doc-contents ">
|
|
|
|
<p>Wave operator for <code>[E, H]</code> field representation. This operator implements Maxwell's
|
|
equations without cancelling out either E or H. The operator is
|
|
$$ \begin{bmatrix}
|
|
-\imath \omega \epsilon & \nabla \times \
|
|
\nabla \times & \imath \omega \mu
|
|
\end{bmatrix} $$</p>
|
|
<div class="highlight"><pre><span></span><code>[[-i * omega * epsilon, del x ],
|
|
[del x, i * omega * mu]]
|
|
</code></pre></div>
|
|
<p>for use with a field vector of the form <code>cat(vec(E), vec(H))</code>:
|
|
$$ \begin{bmatrix}
|
|
-\imath \omega \epsilon & \nabla \times \
|
|
\nabla \times & \imath \omega \mu
|
|
\end{bmatrix}
|
|
\begin{bmatrix} E \
|
|
H
|
|
\end{bmatrix}
|
|
= \begin{bmatrix} J \
|
|
-M
|
|
\end{bmatrix} $$</p>
|
|
|
|
|
|
<p><span class="doc-section-title">Parameters:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
<th>Default</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>omega</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#complex">complex</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Angular frequency of the simulation</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>dxes</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" dx_lists_t
|
|
|
|
|
|
|
|
module-attribute
|
|
(meanas.fdmath.dx_lists_t)" href="#api-fdmath-meanas.fdmath.types.dx_lists_t">dx_lists_t</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Grid parameters <code>[dx_e, dx_h]</code> as described in <code>meanas.fdmath.types</code></p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>epsilon</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" vfdfield (meanas.fdmath.vfdfield)" href="#api-fdmath-meanas.fdmath.types.vfdfield2">vfdfield</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Vectorized dielectric constant</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>mu</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" vfdfield (meanas.fdmath.vfdfield)" href="#api-fdmath-meanas.fdmath.types.vfdfield2">vfdfield</a> | None</code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Vectorized magnetic permeability (default 1 everywhere)</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<code>None</code>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>pec</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" vfdfield (meanas.fdmath.vfdfield)" href="#api-fdmath-meanas.fdmath.types.vfdfield2">vfdfield</a> | None</code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Vectorized mask specifying PEC cells. Any cells where <code>pec != 0</code> are interpreted
|
|
as containing a perfect electrical conductor (PEC).
|
|
The PEC is applied per-field-component (i.e. <code>pec.size == epsilon.size</code>)</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<code>None</code>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>pmc</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" vfdfield (meanas.fdmath.vfdfield)" href="#api-fdmath-meanas.fdmath.types.vfdfield2">vfdfield</a> | None</code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Vectorized mask specifying PMC cells. Any cells where <code>pmc != 0</code> are interpreted
|
|
as containing a perfect magnetic conductor (PMC).
|
|
The PMC is applied per-field-component (i.e. <code>pmc.size == epsilon.size</code>)</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<code>None</code>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
<p><span class="doc-section-title">Returns:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title="scipy.sparse.sparray" href="#scipy.sparse.sparray">sparray</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Sparse matrix containing the wave operator.</p>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="doc doc-object doc-function">
|
|
|
|
|
|
<h3 id="api-fdfd-meanas.fdfd.operators.e2h" class="doc doc-heading">
|
|
<code class="doc-symbol doc-symbol-heading doc-symbol-function"></code> <span class="doc doc-object-name doc-function-name">e2h</span>
|
|
|
|
|
|
<a href="#api-fdfd-meanas.fdfd.operators.e2h" class="headerlink" title="Permanent link">¶</a></h3>
|
|
<div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#api-fdfd-__codelineno-0-1"></a><span class="nf">e2h</span><span class="p">(</span>
|
|
<a id="__codelineno-0-2" name="__codelineno-0-2" href="#api-fdfd-__codelineno-0-2"></a> <span class="n">omega</span><span class="p">:</span> <span class="nb">complex</span><span class="p">,</span>
|
|
<a id="__codelineno-0-3" name="__codelineno-0-3" href="#api-fdfd-__codelineno-0-3"></a> <span class="n">dxes</span><span class="p">:</span> <span class="n">dx_lists_t</span><span class="p">,</span>
|
|
<a id="__codelineno-0-4" name="__codelineno-0-4" href="#api-fdfd-__codelineno-0-4"></a> <span class="n">mu</span><span class="p">:</span> <span class="n">vfdfield</span> <span class="o">|</span> <span class="kc">None</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
|
|
<a id="__codelineno-0-5" name="__codelineno-0-5" href="#api-fdfd-__codelineno-0-5"></a> <span class="n">pmc</span><span class="p">:</span> <span class="n">vfdfield</span> <span class="o">|</span> <span class="kc">None</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
|
|
<a id="__codelineno-0-6" name="__codelineno-0-6" href="#api-fdfd-__codelineno-0-6"></a><span class="p">)</span> <span class="o">-></span> <span class="n">sparse</span><span class="o">.</span><span class="n">sparray</span>
|
|
</code></pre></div>
|
|
|
|
<div class="doc doc-contents ">
|
|
|
|
<p>Utility operator for converting the E field into the H field.
|
|
For use with <code>e_full()</code> -- assumes that there is no magnetic current M.</p>
|
|
|
|
|
|
<p><span class="doc-section-title">Parameters:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
<th>Default</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>omega</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#complex">complex</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Angular frequency of the simulation</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>dxes</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" dx_lists_t
|
|
|
|
|
|
|
|
module-attribute
|
|
(meanas.fdmath.dx_lists_t)" href="#api-fdmath-meanas.fdmath.types.dx_lists_t">dx_lists_t</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Grid parameters <code>[dx_e, dx_h]</code> as described in <code>meanas.fdmath.types</code></p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>mu</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" vfdfield (meanas.fdmath.vfdfield)" href="#api-fdmath-meanas.fdmath.types.vfdfield2">vfdfield</a> | None</code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Vectorized magnetic permeability (default 1 everywhere)</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<code>None</code>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>pmc</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" vfdfield (meanas.fdmath.vfdfield)" href="#api-fdmath-meanas.fdmath.types.vfdfield2">vfdfield</a> | None</code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Vectorized mask specifying PMC cells. Any cells where <code>pmc != 0</code> are interpreted
|
|
as containing a perfect magnetic conductor (PMC).
|
|
The PMC is applied per-field-component (i.e. <code>pmc.size == epsilon.size</code>)</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<code>None</code>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
<p><span class="doc-section-title">Returns:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title="scipy.sparse.sparray" href="#scipy.sparse.sparray">sparray</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Sparse matrix for converting E to H.</p>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="doc doc-object doc-function">
|
|
|
|
|
|
<h3 id="api-fdfd-meanas.fdfd.operators.m2j" class="doc doc-heading">
|
|
<code class="doc-symbol doc-symbol-heading doc-symbol-function"></code> <span class="doc doc-object-name doc-function-name">m2j</span>
|
|
|
|
|
|
<a href="#api-fdfd-meanas.fdfd.operators.m2j" class="headerlink" title="Permanent link">¶</a></h3>
|
|
<div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#api-fdfd-__codelineno-0-1"></a><span class="nf">m2j</span><span class="p">(</span>
|
|
<a id="__codelineno-0-2" name="__codelineno-0-2" href="#api-fdfd-__codelineno-0-2"></a> <span class="n">omega</span><span class="p">:</span> <span class="nb">complex</span><span class="p">,</span>
|
|
<a id="__codelineno-0-3" name="__codelineno-0-3" href="#api-fdfd-__codelineno-0-3"></a> <span class="n">dxes</span><span class="p">:</span> <span class="n">dx_lists_t</span><span class="p">,</span>
|
|
<a id="__codelineno-0-4" name="__codelineno-0-4" href="#api-fdfd-__codelineno-0-4"></a> <span class="n">mu</span><span class="p">:</span> <span class="n">vfdfield</span> <span class="o">|</span> <span class="kc">None</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
|
|
<a id="__codelineno-0-5" name="__codelineno-0-5" href="#api-fdfd-__codelineno-0-5"></a><span class="p">)</span> <span class="o">-></span> <span class="n">sparse</span><span class="o">.</span><span class="n">sparray</span>
|
|
</code></pre></div>
|
|
|
|
<div class="doc doc-contents ">
|
|
|
|
<p>Operator for converting a magnetic current M into an electric current J.
|
|
For use with eg. <code>e_full()</code>.</p>
|
|
|
|
|
|
<p><span class="doc-section-title">Parameters:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
<th>Default</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>omega</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#complex">complex</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Angular frequency of the simulation</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>dxes</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" dx_lists_t
|
|
|
|
|
|
|
|
module-attribute
|
|
(meanas.fdmath.dx_lists_t)" href="#api-fdmath-meanas.fdmath.types.dx_lists_t">dx_lists_t</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Grid parameters <code>[dx_e, dx_h]</code> as described in <code>meanas.fdmath.types</code></p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>mu</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" vfdfield (meanas.fdmath.vfdfield)" href="#api-fdmath-meanas.fdmath.types.vfdfield2">vfdfield</a> | None</code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Vectorized magnetic permeability (default 1 everywhere)</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<code>None</code>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
<p><span class="doc-section-title">Returns:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title="scipy.sparse.sparray" href="#scipy.sparse.sparray">sparray</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Sparse matrix for converting M to J.</p>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="doc doc-object doc-function">
|
|
|
|
|
|
<h3 id="api-fdfd-meanas.fdfd.operators.poynting_e_cross" class="doc doc-heading">
|
|
<code class="doc-symbol doc-symbol-heading doc-symbol-function"></code> <span class="doc doc-object-name doc-function-name">poynting_e_cross</span>
|
|
|
|
|
|
<a href="#api-fdfd-meanas.fdfd.operators.poynting_e_cross" class="headerlink" title="Permanent link">¶</a></h3>
|
|
<div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#api-fdfd-__codelineno-0-1"></a><span class="nf">poynting_e_cross</span><span class="p">(</span>
|
|
<a id="__codelineno-0-2" name="__codelineno-0-2" href="#api-fdfd-__codelineno-0-2"></a> <span class="n">e</span><span class="p">:</span> <span class="n">vcfdfield</span><span class="p">,</span> <span class="n">dxes</span><span class="p">:</span> <span class="n">dx_lists_t</span>
|
|
<a id="__codelineno-0-3" name="__codelineno-0-3" href="#api-fdfd-__codelineno-0-3"></a><span class="p">)</span> <span class="o">-></span> <span class="n">sparse</span><span class="o">.</span><span class="n">sparray</span>
|
|
</code></pre></div>
|
|
|
|
<div class="doc doc-contents ">
|
|
|
|
<p>Operator for computing the staggered-grid <code>(E \times)</code> part of the Poynting vector.</p>
|
|
<p>On the Yee grid the E and H components live on different edges, so the
|
|
electric field must be shifted by one cell in the appropriate direction
|
|
before forming the discrete cross product. This sparse operator encodes that
|
|
shifted cross product directly and is the matrix equivalent of
|
|
<code>functional.poynting_e_cross_h(...)</code>.</p>
|
|
|
|
|
|
<p><span class="doc-section-title">Parameters:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
<th>Default</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>e</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" vcfdfield (meanas.fdmath.vcfdfield)" href="#api-fdmath-meanas.fdmath.types.vcfdfield">vcfdfield</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Vectorized E-field for the ExH cross product</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>dxes</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" dx_lists_t
|
|
|
|
|
|
|
|
module-attribute
|
|
(meanas.fdmath.dx_lists_t)" href="#api-fdmath-meanas.fdmath.types.dx_lists_t">dx_lists_t</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Grid parameters <code>[dx_e, dx_h]</code> as described in <code>meanas.fdmath.types</code></p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
<p><span class="doc-section-title">Returns:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title="scipy.sparse.sparray" href="#scipy.sparse.sparray">sparray</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Sparse matrix containing the <code>(E \times)</code> part of the staggered Poynting</p>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title="scipy.sparse.sparray" href="#scipy.sparse.sparray">sparray</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>cross product.</p>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="doc doc-object doc-function">
|
|
|
|
|
|
<h3 id="api-fdfd-meanas.fdfd.operators.poynting_h_cross" class="doc doc-heading">
|
|
<code class="doc-symbol doc-symbol-heading doc-symbol-function"></code> <span class="doc doc-object-name doc-function-name">poynting_h_cross</span>
|
|
|
|
|
|
<a href="#api-fdfd-meanas.fdfd.operators.poynting_h_cross" class="headerlink" title="Permanent link">¶</a></h3>
|
|
<div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#api-fdfd-__codelineno-0-1"></a><span class="nf">poynting_h_cross</span><span class="p">(</span>
|
|
<a id="__codelineno-0-2" name="__codelineno-0-2" href="#api-fdfd-__codelineno-0-2"></a> <span class="n">h</span><span class="p">:</span> <span class="n">vcfdfield</span><span class="p">,</span> <span class="n">dxes</span><span class="p">:</span> <span class="n">dx_lists_t</span>
|
|
<a id="__codelineno-0-3" name="__codelineno-0-3" href="#api-fdfd-__codelineno-0-3"></a><span class="p">)</span> <span class="o">-></span> <span class="n">sparse</span><span class="o">.</span><span class="n">sparray</span>
|
|
</code></pre></div>
|
|
|
|
<div class="doc doc-contents ">
|
|
|
|
<p>Operator for computing the staggered-grid <code>(H \times)</code> part of the Poynting vector.</p>
|
|
<p>Together with <code>poynting_e_cross(...)</code>, this provides the matrix form of the
|
|
Yee-grid cross product used in the flux helpers. The two are related by the
|
|
usual antisymmetry of the cross product,</p>
|
|
<div class="arithmatex">\[
|
|
H \times E = -(E \times H),
|
|
\]</div>
|
|
<p>once the same staggered field placement is used on both sides.</p>
|
|
|
|
|
|
<p><span class="doc-section-title">Parameters:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
<th>Default</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>h</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" vcfdfield (meanas.fdmath.vcfdfield)" href="#api-fdmath-meanas.fdmath.types.vcfdfield">vcfdfield</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Vectorized H-field for the HxE cross product</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>dxes</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" dx_lists_t
|
|
|
|
|
|
|
|
module-attribute
|
|
(meanas.fdmath.dx_lists_t)" href="#api-fdmath-meanas.fdmath.types.dx_lists_t">dx_lists_t</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Grid parameters <code>[dx_e, dx_h]</code> as described in <code>meanas.fdmath.types</code></p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
<p><span class="doc-section-title">Returns:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title="scipy.sparse.sparray" href="#scipy.sparse.sparray">sparray</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Sparse matrix containing the <code>(H \times)</code> part of the staggered Poynting</p>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title="scipy.sparse.sparray" href="#scipy.sparse.sparray">sparray</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>cross product.</p>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="doc doc-object doc-function">
|
|
|
|
|
|
<h3 id="api-fdfd-meanas.fdfd.operators.e_tfsf_source" class="doc doc-heading">
|
|
<code class="doc-symbol doc-symbol-heading doc-symbol-function"></code> <span class="doc doc-object-name doc-function-name">e_tfsf_source</span>
|
|
|
|
|
|
<a href="#api-fdfd-meanas.fdfd.operators.e_tfsf_source" class="headerlink" title="Permanent link">¶</a></h3>
|
|
<div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#api-fdfd-__codelineno-0-1"></a><span class="nf">e_tfsf_source</span><span class="p">(</span>
|
|
<a id="__codelineno-0-2" name="__codelineno-0-2" href="#api-fdfd-__codelineno-0-2"></a> <span class="n">TF_region</span><span class="p">:</span> <span class="n">vfdfield</span><span class="p">,</span>
|
|
<a id="__codelineno-0-3" name="__codelineno-0-3" href="#api-fdfd-__codelineno-0-3"></a> <span class="n">omega</span><span class="p">:</span> <span class="nb">complex</span><span class="p">,</span>
|
|
<a id="__codelineno-0-4" name="__codelineno-0-4" href="#api-fdfd-__codelineno-0-4"></a> <span class="n">dxes</span><span class="p">:</span> <span class="n">dx_lists_t</span><span class="p">,</span>
|
|
<a id="__codelineno-0-5" name="__codelineno-0-5" href="#api-fdfd-__codelineno-0-5"></a> <span class="n">epsilon</span><span class="p">:</span> <span class="n">vfdfield</span><span class="p">,</span>
|
|
<a id="__codelineno-0-6" name="__codelineno-0-6" href="#api-fdfd-__codelineno-0-6"></a> <span class="n">mu</span><span class="p">:</span> <span class="n">vfdfield</span> <span class="o">|</span> <span class="kc">None</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
|
|
<a id="__codelineno-0-7" name="__codelineno-0-7" href="#api-fdfd-__codelineno-0-7"></a><span class="p">)</span> <span class="o">-></span> <span class="n">sparse</span><span class="o">.</span><span class="n">sparray</span>
|
|
</code></pre></div>
|
|
|
|
<div class="doc doc-contents ">
|
|
|
|
<p>Operator that turns a desired E-field distribution into a
|
|
total-field/scattered-field (TFSF) source.</p>
|
|
<p>Let <code>A</code> be the full wave operator from <code>e_full(...)</code>, and let
|
|
<code>Q = \mathrm{diag}(TF_region)</code> be the projector onto the total-field region.
|
|
Then the TFSF current operator is the commutator</p>
|
|
<div class="arithmatex">\[
|
|
\frac{A Q - Q A}{-i \omega}.
|
|
\]</div>
|
|
<p>Inside regions where <code>Q</code> is locally constant, <code>A</code> and <code>Q</code> commute and the
|
|
source vanishes. Only cells at the TF/SF boundary contribute nonzero current,
|
|
which is exactly the desired distributed source for injecting the chosen
|
|
field into the total-field region without directly forcing the
|
|
scattered-field region.</p>
|
|
|
|
|
|
<p><span class="doc-section-title">Parameters:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
<th>Default</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>TF_region</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" vfdfield (meanas.fdmath.vfdfield)" href="#api-fdmath-meanas.fdmath.types.vfdfield2">vfdfield</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Mask, which is set to 1 inside the total-field region and 0 in the
|
|
scattered-field region</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>omega</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#complex">complex</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Angular frequency of the simulation</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>dxes</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" dx_lists_t
|
|
|
|
|
|
|
|
module-attribute
|
|
(meanas.fdmath.dx_lists_t)" href="#api-fdmath-meanas.fdmath.types.dx_lists_t">dx_lists_t</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Grid parameters <code>[dx_e, dx_h]</code> as described in <code>meanas.fdmath.types</code></p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>epsilon</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" vfdfield (meanas.fdmath.vfdfield)" href="#api-fdmath-meanas.fdmath.types.vfdfield2">vfdfield</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Vectorized dielectric constant</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>mu</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" vfdfield (meanas.fdmath.vfdfield)" href="#api-fdmath-meanas.fdmath.types.vfdfield2">vfdfield</a> | None</code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Vectorized magnetic permeability (default 1 everywhere).</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<code>None</code>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
<p><span class="doc-section-title">Returns:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title="scipy.sparse.sparray" href="#scipy.sparse.sparray">sparray</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Sparse matrix that turns an E-field into a current (J) distribution.</p>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="doc doc-object doc-function">
|
|
|
|
|
|
<h3 id="api-fdfd-meanas.fdfd.operators.e_boundary_source" class="doc doc-heading">
|
|
<code class="doc-symbol doc-symbol-heading doc-symbol-function"></code> <span class="doc doc-object-name doc-function-name">e_boundary_source</span>
|
|
|
|
|
|
<a href="#api-fdfd-meanas.fdfd.operators.e_boundary_source" class="headerlink" title="Permanent link">¶</a></h3>
|
|
<div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#api-fdfd-__codelineno-0-1"></a><span class="nf">e_boundary_source</span><span class="p">(</span>
|
|
<a id="__codelineno-0-2" name="__codelineno-0-2" href="#api-fdfd-__codelineno-0-2"></a> <span class="n">mask</span><span class="p">:</span> <span class="n">vfdfield</span><span class="p">,</span>
|
|
<a id="__codelineno-0-3" name="__codelineno-0-3" href="#api-fdfd-__codelineno-0-3"></a> <span class="n">omega</span><span class="p">:</span> <span class="nb">complex</span><span class="p">,</span>
|
|
<a id="__codelineno-0-4" name="__codelineno-0-4" href="#api-fdfd-__codelineno-0-4"></a> <span class="n">dxes</span><span class="p">:</span> <span class="n">dx_lists_t</span><span class="p">,</span>
|
|
<a id="__codelineno-0-5" name="__codelineno-0-5" href="#api-fdfd-__codelineno-0-5"></a> <span class="n">epsilon</span><span class="p">:</span> <span class="n">vfdfield</span><span class="p">,</span>
|
|
<a id="__codelineno-0-6" name="__codelineno-0-6" href="#api-fdfd-__codelineno-0-6"></a> <span class="n">mu</span><span class="p">:</span> <span class="n">vfdfield</span> <span class="o">|</span> <span class="kc">None</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
|
|
<a id="__codelineno-0-7" name="__codelineno-0-7" href="#api-fdfd-__codelineno-0-7"></a> <span class="n">periodic_mask_edges</span><span class="p">:</span> <span class="nb">bool</span> <span class="o">=</span> <span class="kc">False</span><span class="p">,</span>
|
|
<a id="__codelineno-0-8" name="__codelineno-0-8" href="#api-fdfd-__codelineno-0-8"></a><span class="p">)</span> <span class="o">-></span> <span class="n">sparse</span><span class="o">.</span><span class="n">sparray</span>
|
|
</code></pre></div>
|
|
|
|
<div class="doc doc-contents ">
|
|
|
|
<p>Operator that turns an E-field distrubtion into a current (J) distribution
|
|
along the edges (external and internal) of the provided mask. This is just an
|
|
<code>e_tfsf_source()</code> with an additional masking step.</p>
|
|
<p>Equivalently, this helper first constructs the TFSF commutator source for the
|
|
full mask and then zeroes out all cells except the mask boundary. The
|
|
boundary is defined as the set of cells whose mask value changes under a
|
|
one-cell shift in any Cartesian direction. With <code>periodic_mask_edges=False</code>
|
|
the shifts mirror at the domain boundary; with <code>True</code> they wrap periodically.</p>
|
|
|
|
|
|
<p><span class="doc-section-title">Parameters:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
<th>Default</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>mask</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" vfdfield (meanas.fdmath.vfdfield)" href="#api-fdmath-meanas.fdmath.types.vfdfield2">vfdfield</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>The current distribution is generated at the edges of the mask,
|
|
i.e. any points where shifting the mask by one cell in any direction
|
|
would change its value.</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>omega</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#complex">complex</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Angular frequency of the simulation</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>dxes</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" dx_lists_t
|
|
|
|
|
|
|
|
module-attribute
|
|
(meanas.fdmath.dx_lists_t)" href="#api-fdmath-meanas.fdmath.types.dx_lists_t">dx_lists_t</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Grid parameters <code>[dx_e, dx_h]</code> as described in <code>meanas.fdmath.types</code></p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>epsilon</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" vfdfield (meanas.fdmath.vfdfield)" href="#api-fdmath-meanas.fdmath.types.vfdfield2">vfdfield</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Vectorized dielectric constant</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>mu</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" vfdfield (meanas.fdmath.vfdfield)" href="#api-fdmath-meanas.fdmath.types.vfdfield2">vfdfield</a> | None</code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Vectorized magnetic permeability (default 1 everywhere).</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<code>None</code>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
<p><span class="doc-section-title">Returns:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title="scipy.sparse.sparray" href="#scipy.sparse.sparray">sparray</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Sparse matrix that turns an E-field into a current (J) distribution.</p>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="doc doc-object doc-module">
|
|
|
|
|
|
|
|
<h2 id="api-fdfd-meanas.fdfd.solvers" class="doc doc-heading">
|
|
<code class="doc-symbol doc-symbol-heading doc-symbol-module"></code> <span class="doc doc-object-name doc-module-name">meanas.fdfd.solvers</span>
|
|
|
|
|
|
<a href="#api-fdfd-meanas.fdfd.solvers" class="headerlink" title="Permanent link">¶</a></h2>
|
|
|
|
<div class="doc doc-contents first">
|
|
|
|
<p>Solvers and solver interface for FDFD problems.</p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="doc doc-children">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="doc doc-object doc-function">
|
|
|
|
|
|
<h3 id="api-fdfd-meanas.fdfd.solvers.generic" class="doc doc-heading">
|
|
<code class="doc-symbol doc-symbol-heading doc-symbol-function"></code> <span class="doc doc-object-name doc-function-name">generic</span>
|
|
|
|
|
|
<a href="#api-fdfd-meanas.fdfd.solvers.generic" class="headerlink" title="Permanent link">¶</a></h3>
|
|
<div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#api-fdfd-__codelineno-0-1"></a><span class="nf">generic</span><span class="p">(</span>
|
|
<a id="__codelineno-0-2" name="__codelineno-0-2" href="#api-fdfd-__codelineno-0-2"></a> <span class="n">omega</span><span class="p">:</span> <span class="nb">complex</span><span class="p">,</span>
|
|
<a id="__codelineno-0-3" name="__codelineno-0-3" href="#api-fdfd-__codelineno-0-3"></a> <span class="n">dxes</span><span class="p">:</span> <span class="n">dx_lists_t</span><span class="p">,</span>
|
|
<a id="__codelineno-0-4" name="__codelineno-0-4" href="#api-fdfd-__codelineno-0-4"></a> <span class="n">J</span><span class="p">:</span> <span class="n">vcfdfield</span><span class="p">,</span>
|
|
<a id="__codelineno-0-5" name="__codelineno-0-5" href="#api-fdfd-__codelineno-0-5"></a> <span class="n">epsilon</span><span class="p">:</span> <span class="n">vfdfield</span><span class="p">,</span>
|
|
<a id="__codelineno-0-6" name="__codelineno-0-6" href="#api-fdfd-__codelineno-0-6"></a> <span class="n">mu</span><span class="p">:</span> <span class="n">vfdfield</span> <span class="o">|</span> <span class="kc">None</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
|
|
<a id="__codelineno-0-7" name="__codelineno-0-7" href="#api-fdfd-__codelineno-0-7"></a> <span class="o">*</span><span class="p">,</span>
|
|
<a id="__codelineno-0-8" name="__codelineno-0-8" href="#api-fdfd-__codelineno-0-8"></a> <span class="n">pec</span><span class="p">:</span> <span class="n">vfdfield</span> <span class="o">|</span> <span class="kc">None</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
|
|
<a id="__codelineno-0-9" name="__codelineno-0-9" href="#api-fdfd-__codelineno-0-9"></a> <span class="n">pmc</span><span class="p">:</span> <span class="n">vfdfield</span> <span class="o">|</span> <span class="kc">None</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
|
|
<a id="__codelineno-0-10" name="__codelineno-0-10" href="#api-fdfd-__codelineno-0-10"></a> <span class="n">adjoint</span><span class="p">:</span> <span class="nb">bool</span> <span class="o">=</span> <span class="kc">False</span><span class="p">,</span>
|
|
<a id="__codelineno-0-11" name="__codelineno-0-11" href="#api-fdfd-__codelineno-0-11"></a> <span class="n">matrix_solver</span><span class="p">:</span> <span class="n">Callable</span><span class="p">[</span><span class="o">...</span><span class="p">,</span> <span class="n">ArrayLike</span><span class="p">]</span> <span class="o">=</span> <span class="n">_scipy_qmr</span><span class="p">,</span>
|
|
<a id="__codelineno-0-12" name="__codelineno-0-12" href="#api-fdfd-__codelineno-0-12"></a> <span class="n">matrix_solver_opts</span><span class="p">:</span> <span class="nb">dict</span><span class="p">[</span><span class="nb">str</span><span class="p">,</span> <span class="n">Any</span><span class="p">]</span> <span class="o">|</span> <span class="kc">None</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
|
|
<a id="__codelineno-0-13" name="__codelineno-0-13" href="#api-fdfd-__codelineno-0-13"></a> <span class="n">E_guess</span><span class="p">:</span> <span class="n">vcfdfield</span> <span class="o">|</span> <span class="kc">None</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
|
|
<a id="__codelineno-0-14" name="__codelineno-0-14" href="#api-fdfd-__codelineno-0-14"></a><span class="p">)</span> <span class="o">-></span> <span class="n">vcfdfield_t</span>
|
|
</code></pre></div>
|
|
|
|
<div class="doc doc-contents ">
|
|
|
|
<p>Conjugate gradient FDFD solver using CSR sparse matrices.</p>
|
|
<p>All ndarray arguments should be 1D arrays, as returned by <code>meanas.fdmath.vectorization.vec()</code>.</p>
|
|
|
|
|
|
<p><span class="doc-section-title">Parameters:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
<th>Default</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>omega</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#complex">complex</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Complex frequency to solve at.</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>dxes</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" dx_lists_t
|
|
|
|
|
|
|
|
module-attribute
|
|
(meanas.fdmath.dx_lists_t)" href="#api-fdmath-meanas.fdmath.types.dx_lists_t">dx_lists_t</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p><code>[[dx_e, dy_e, dz_e], [dx_h, dy_h, dz_h]]</code> (complex cell sizes) as
|
|
discussed in <code>meanas.fdmath.types</code></p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>J</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" vcfdfield (meanas.fdmath.vcfdfield)" href="#api-fdmath-meanas.fdmath.types.vcfdfield">vcfdfield</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Electric current distribution (at E-field locations)</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>epsilon</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" vfdfield (meanas.fdmath.vfdfield)" href="#api-fdmath-meanas.fdmath.types.vfdfield2">vfdfield</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Dielectric constant distribution (at E-field locations)</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>mu</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" vfdfield (meanas.fdmath.vfdfield)" href="#api-fdmath-meanas.fdmath.types.vfdfield2">vfdfield</a> | None</code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Magnetic permeability distribution (at H-field locations)</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<code>None</code>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>pec</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" vfdfield (meanas.fdmath.vfdfield)" href="#api-fdmath-meanas.fdmath.types.vfdfield2">vfdfield</a> | None</code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Perfect electric conductor distribution
|
|
(at E-field locations; non-zero value indicates PEC is present)</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<code>None</code>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>pmc</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" vfdfield (meanas.fdmath.vfdfield)" href="#api-fdmath-meanas.fdmath.types.vfdfield2">vfdfield</a> | None</code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Perfect magnetic conductor distribution
|
|
(at H-field locations; non-zero value indicates PMC is present)</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<code>None</code>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>adjoint</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#bool">bool</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>If true, solves the adjoint problem.</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<code>False</code>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>matrix_solver</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title="collections.abc.Callable" href="#collections.abc.Callable">Callable</a>[..., <a class="autorefs autorefs-internal" title="numpy.typing.ArrayLike" href="#numpy.typing.ArrayLike">ArrayLike</a>]</code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Called as <code>matrix_solver(A, b, **matrix_solver_opts) -> x</code>,
|
|
where <code>A</code>: <code>scipy.sparse.csr_array</code>;
|
|
<code>b</code>: <code>ArrayLike</code>;
|
|
<code>x</code>: <code>ArrayLike</code>;
|
|
Default is a wrapped version of <code>scipy.sparse.linalg.qmr()</code>
|
|
which doesn't return convergence info and logs the residual
|
|
every 100 iterations.</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title="meanas.fdfd.solvers._scipy_qmr" href="#meanas.fdfd.solvers._scipy_qmr">_scipy_qmr</a></code>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>matrix_solver_opts</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#dict">dict</a>[<a class="autorefs autorefs-internal" href="#api-fdmath-meanas.fdmath--datastructure-dx_lists_t">str</a>, <a class="autorefs autorefs-internal" title="typing.Any" href="#typing.Any">Any</a>] | None</code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Passed as kwargs to <code>matrix_solver(...)</code></p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<code>None</code>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>E_guess</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" vcfdfield (meanas.fdmath.vcfdfield)" href="#api-fdmath-meanas.fdmath.types.vcfdfield">vcfdfield</a> | None</code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Guess at the solution E-field. <code>matrix_solver</code> must accept an
|
|
<code>x0</code> argument with the same purpose.</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<code>None</code>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
<p><span class="doc-section-title">Returns:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title="meanas.fdmath.vcfdfield_t" href="#meanas.fdmath.vcfdfield_t">vcfdfield_t</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>E-field which solves the system.</p>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="doc doc-object doc-module">
|
|
|
|
|
|
|
|
<h2 id="api-fdfd-meanas.fdfd.scpml" class="doc doc-heading">
|
|
<code class="doc-symbol doc-symbol-heading doc-symbol-module"></code> <span class="doc doc-object-name doc-module-name">meanas.fdfd.scpml</span>
|
|
|
|
|
|
<a href="#api-fdfd-meanas.fdfd.scpml" class="headerlink" title="Permanent link">¶</a></h2>
|
|
|
|
<div class="doc doc-contents first">
|
|
|
|
<p>Functions for creating stretched coordinate perfectly matched layer (PML) absorbers.</p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="doc doc-children">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="doc doc-object doc-attribute">
|
|
|
|
|
|
|
|
<h3 id="api-fdfd-meanas.fdfd.scpml.s_function_t" class="doc doc-heading">
|
|
<code class="doc-symbol doc-symbol-heading doc-symbol-attribute"></code> <span class="doc doc-object-name doc-attribute-name">s_function_t</span>
|
|
|
|
|
|
<span class="doc doc-labels">
|
|
<small class="doc doc-label doc-label-module-attribute"><code>module-attribute</code></small>
|
|
</span>
|
|
|
|
<a href="#api-fdfd-meanas.fdfd.scpml.s_function_t" class="headerlink" title="Permanent link">¶</a></h3>
|
|
<div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#api-fdfd-__codelineno-0-1"></a><span class="n">s_function_t</span> <span class="o">=</span> <span class="n">Callable</span><span class="p">[</span>
|
|
<a id="__codelineno-0-2" name="__codelineno-0-2" href="#api-fdfd-__codelineno-0-2"></a> <span class="p">[</span><span class="n">NDArray</span><span class="p">[</span><span class="n">float64</span><span class="p">]],</span> <span class="n">NDArray</span><span class="p">[</span><span class="n">float64</span><span class="p">]</span>
|
|
<a id="__codelineno-0-3" name="__codelineno-0-3" href="#api-fdfd-__codelineno-0-3"></a><span class="p">]</span>
|
|
</code></pre></div>
|
|
|
|
<div class="doc doc-contents ">
|
|
|
|
<p>Typedef for s-functions, see <code>prepare_s_function()</code></p>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="doc doc-object doc-function">
|
|
|
|
|
|
<h3 id="api-fdfd-meanas.fdfd.scpml.prepare_s_function" class="doc doc-heading">
|
|
<code class="doc-symbol doc-symbol-heading doc-symbol-function"></code> <span class="doc doc-object-name doc-function-name">prepare_s_function</span>
|
|
|
|
|
|
<a href="#api-fdfd-meanas.fdfd.scpml.prepare_s_function" class="headerlink" title="Permanent link">¶</a></h3>
|
|
<div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#api-fdfd-__codelineno-0-1"></a><span class="nf">prepare_s_function</span><span class="p">(</span>
|
|
<a id="__codelineno-0-2" name="__codelineno-0-2" href="#api-fdfd-__codelineno-0-2"></a> <span class="n">ln_R</span><span class="p">:</span> <span class="nb">float</span> <span class="o">=</span> <span class="o">-</span><span class="mi">16</span><span class="p">,</span> <span class="n">m</span><span class="p">:</span> <span class="nb">float</span> <span class="o">=</span> <span class="mi">4</span>
|
|
<a id="__codelineno-0-3" name="__codelineno-0-3" href="#api-fdfd-__codelineno-0-3"></a><span class="p">)</span> <span class="o">-></span> <span class="n">s_function_t</span>
|
|
</code></pre></div>
|
|
|
|
<div class="doc doc-contents ">
|
|
|
|
<p>Create an s_function to pass to the SCPML functions. This is used when you would like to
|
|
customize the PML parameters.</p>
|
|
|
|
|
|
<p><span class="doc-section-title">Parameters:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
<th>Default</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>ln_R</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#float">float</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Natural logarithm of the desired reflectance</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<code>-16</code>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>m</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#float">float</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Polynomial order for the PML (imaginary part increases as distance ** m)</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<code>4</code>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
<p><span class="doc-section-title">Returns:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" s_function_t
|
|
|
|
|
|
|
|
module-attribute
|
|
(meanas.fdfd.scpml.s_function_t)" href="#api-fdfd-meanas.fdfd.scpml.s_function_t">s_function_t</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>An s_function, which takes an ndarray (distances) and returns an ndarray (complex part</p>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" s_function_t
|
|
|
|
|
|
|
|
module-attribute
|
|
(meanas.fdfd.scpml.s_function_t)" href="#api-fdfd-meanas.fdfd.scpml.s_function_t">s_function_t</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>of the cell width; needs to be divided by <code>sqrt(epilon_effective) * real(omega))</code></p>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" s_function_t
|
|
|
|
|
|
|
|
module-attribute
|
|
(meanas.fdfd.scpml.s_function_t)" href="#api-fdfd-meanas.fdfd.scpml.s_function_t">s_function_t</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>before use.</p>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="doc doc-object doc-function">
|
|
|
|
|
|
<h3 id="api-fdfd-meanas.fdfd.scpml.uniform_grid_scpml" class="doc doc-heading">
|
|
<code class="doc-symbol doc-symbol-heading doc-symbol-function"></code> <span class="doc doc-object-name doc-function-name">uniform_grid_scpml</span>
|
|
|
|
|
|
<a href="#api-fdfd-meanas.fdfd.scpml.uniform_grid_scpml" class="headerlink" title="Permanent link">¶</a></h3>
|
|
<div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#api-fdfd-__codelineno-0-1"></a><span class="nf">uniform_grid_scpml</span><span class="p">(</span>
|
|
<a id="__codelineno-0-2" name="__codelineno-0-2" href="#api-fdfd-__codelineno-0-2"></a> <span class="n">shape</span><span class="p">:</span> <span class="n">Sequence</span><span class="p">[</span><span class="nb">int</span><span class="p">],</span>
|
|
<a id="__codelineno-0-3" name="__codelineno-0-3" href="#api-fdfd-__codelineno-0-3"></a> <span class="n">thicknesses</span><span class="p">:</span> <span class="n">Sequence</span><span class="p">[</span><span class="nb">int</span><span class="p">],</span>
|
|
<a id="__codelineno-0-4" name="__codelineno-0-4" href="#api-fdfd-__codelineno-0-4"></a> <span class="n">omega</span><span class="p">:</span> <span class="nb">float</span><span class="p">,</span>
|
|
<a id="__codelineno-0-5" name="__codelineno-0-5" href="#api-fdfd-__codelineno-0-5"></a> <span class="n">epsilon_effective</span><span class="p">:</span> <span class="nb">float</span> <span class="o">=</span> <span class="mf">1.0</span><span class="p">,</span>
|
|
<a id="__codelineno-0-6" name="__codelineno-0-6" href="#api-fdfd-__codelineno-0-6"></a> <span class="n">s_function</span><span class="p">:</span> <span class="n">s_function_t</span> <span class="o">|</span> <span class="kc">None</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
|
|
<a id="__codelineno-0-7" name="__codelineno-0-7" href="#api-fdfd-__codelineno-0-7"></a><span class="p">)</span> <span class="o">-></span> <span class="nb">list</span><span class="p">[</span><span class="nb">list</span><span class="p">[</span><span class="n">NDArray</span><span class="p">[</span><span class="n">numpy</span><span class="o">.</span><span class="n">float64</span><span class="p">]]]</span>
|
|
</code></pre></div>
|
|
|
|
<div class="doc doc-contents ">
|
|
|
|
<p>Create dx arrays for a uniform grid with a cell width of 1 and a pml.</p>
|
|
<p>If you want something more fine-grained, check out <code>stretch_with_scpml(...)</code>.</p>
|
|
|
|
|
|
<p><span class="doc-section-title">Parameters:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
<th>Default</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>shape</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title="collections.abc.Sequence" href="#collections.abc.Sequence">Sequence</a>[<a class="autorefs autorefs-internal" href="#index-recommended-starting-points">int</a>]</code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Shape of the grid, including the PMLs (which are 2*thicknesses thick)</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>thicknesses</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title="collections.abc.Sequence" href="#collections.abc.Sequence">Sequence</a>[<a class="autorefs autorefs-internal" href="#index-recommended-starting-points">int</a>]</code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p><code>[th_x, th_y, th_z]</code>
|
|
Thickness of the PML in each direction.
|
|
Both polarities are added.
|
|
Each th_ of pml is applied twice, once on each edge of the grid along the given axis.
|
|
<code>th_*</code> may be zero, in which case no pml is added.</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>omega</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#float">float</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Angular frequency for the simulation</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>epsilon_effective</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#float">float</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Effective epsilon of the PML. Match this to the material
|
|
at the edge of your grid.
|
|
Default 1.</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<code>1.0</code>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>s_function</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" s_function_t
|
|
|
|
|
|
|
|
module-attribute
|
|
(meanas.fdfd.scpml.s_function_t)" href="#api-fdfd-meanas.fdfd.scpml.s_function_t">s_function_t</a> | None</code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>created by <code>prepare_s_function(...)</code>, allowing customization of pml parameters.
|
|
Default uses <code>prepare_s_function()</code> with no parameters.</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<code>None</code>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
<p><span class="doc-section-title">Returns:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#api-fdmath-meanas.fdmath.types.dx_lists_mut">list</a>[<a class="autorefs autorefs-internal" href="#api-fdmath-meanas.fdmath.types.dx_lists_mut">list</a>[<a class="autorefs autorefs-internal" title="numpy.typing.NDArray" href="#numpy.typing.NDArray">NDArray</a>[<a class="autorefs autorefs-internal" title="numpy.float64" href="#numpy.float64">float64</a>]]]</code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Complex cell widths (dx_lists_mut) as discussed in <code>meanas.fdmath.types</code>.</p>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="doc doc-object doc-function">
|
|
|
|
|
|
<h3 id="api-fdfd-meanas.fdfd.scpml.stretch_with_scpml" class="doc doc-heading">
|
|
<code class="doc-symbol doc-symbol-heading doc-symbol-function"></code> <span class="doc doc-object-name doc-function-name">stretch_with_scpml</span>
|
|
|
|
|
|
<a href="#api-fdfd-meanas.fdfd.scpml.stretch_with_scpml" class="headerlink" title="Permanent link">¶</a></h3>
|
|
<div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#api-fdfd-__codelineno-0-1"></a><span class="nf">stretch_with_scpml</span><span class="p">(</span>
|
|
<a id="__codelineno-0-2" name="__codelineno-0-2" href="#api-fdfd-__codelineno-0-2"></a> <span class="n">dxes</span><span class="p">:</span> <span class="nb">list</span><span class="p">[</span><span class="nb">list</span><span class="p">[</span><span class="n">NDArray</span><span class="p">[</span><span class="n">float64</span><span class="p">]]],</span>
|
|
<a id="__codelineno-0-3" name="__codelineno-0-3" href="#api-fdfd-__codelineno-0-3"></a> <span class="n">axis</span><span class="p">:</span> <span class="nb">int</span><span class="p">,</span>
|
|
<a id="__codelineno-0-4" name="__codelineno-0-4" href="#api-fdfd-__codelineno-0-4"></a> <span class="n">polarity</span><span class="p">:</span> <span class="nb">int</span><span class="p">,</span>
|
|
<a id="__codelineno-0-5" name="__codelineno-0-5" href="#api-fdfd-__codelineno-0-5"></a> <span class="n">omega</span><span class="p">:</span> <span class="nb">float</span><span class="p">,</span>
|
|
<a id="__codelineno-0-6" name="__codelineno-0-6" href="#api-fdfd-__codelineno-0-6"></a> <span class="n">epsilon_effective</span><span class="p">:</span> <span class="nb">float</span> <span class="o">=</span> <span class="mf">1.0</span><span class="p">,</span>
|
|
<a id="__codelineno-0-7" name="__codelineno-0-7" href="#api-fdfd-__codelineno-0-7"></a> <span class="n">thickness</span><span class="p">:</span> <span class="nb">int</span> <span class="o">=</span> <span class="mi">10</span><span class="p">,</span>
|
|
<a id="__codelineno-0-8" name="__codelineno-0-8" href="#api-fdfd-__codelineno-0-8"></a> <span class="n">s_function</span><span class="p">:</span> <span class="n">s_function_t</span> <span class="o">|</span> <span class="kc">None</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
|
|
<a id="__codelineno-0-9" name="__codelineno-0-9" href="#api-fdfd-__codelineno-0-9"></a><span class="p">)</span> <span class="o">-></span> <span class="nb">list</span><span class="p">[</span><span class="nb">list</span><span class="p">[</span><span class="n">NDArray</span><span class="p">[</span><span class="n">numpy</span><span class="o">.</span><span class="n">float64</span><span class="p">]]]</span>
|
|
</code></pre></div>
|
|
|
|
<div class="doc doc-contents ">
|
|
|
|
<p>Stretch dxes to contain a stretched-coordinate PML (SCPML) in one direction along one axis.</p>
|
|
|
|
|
|
<p><span class="doc-section-title">Parameters:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
<th>Default</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>dxes</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#api-fdmath-meanas.fdmath.types.dx_lists_mut">list</a>[<a class="autorefs autorefs-internal" href="#api-fdmath-meanas.fdmath.types.dx_lists_mut">list</a>[<a class="autorefs autorefs-internal" title="numpy.typing.NDArray" href="#numpy.typing.NDArray">NDArray</a>[<a class="autorefs autorefs-internal" title="numpy.float64" href="#numpy.float64">float64</a>]]]</code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Grid parameters <code>[dx_e, dx_h]</code> as described in <code>meanas.fdmath.types</code></p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>axis</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#index-recommended-starting-points">int</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>axis to stretch (0=x, 1=y, 2=z)</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>polarity</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#index-recommended-starting-points">int</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>direction to stretch (-1 for -ve, +1 for +ve)</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>omega</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#float">float</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Angular frequency for the simulation</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>epsilon_effective</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#float">float</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Effective epsilon of the PML. Match this to the material at the
|
|
edge of your grid. Default 1.</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<code>1.0</code>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>thickness</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#index-recommended-starting-points">int</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>number of cells to use for pml (default 10)</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<code>10</code>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>s_function</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" s_function_t
|
|
|
|
|
|
|
|
module-attribute
|
|
(meanas.fdfd.scpml.s_function_t)" href="#api-fdfd-meanas.fdfd.scpml.s_function_t">s_function_t</a> | None</code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Created by <code>prepare_s_function(...)</code>, allowing customization
|
|
of pml parameters. Default uses <code>prepare_s_function()</code> with no parameters.</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<code>None</code>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
<p><span class="doc-section-title">Returns:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#api-fdmath-meanas.fdmath.types.dx_lists_mut">list</a>[<a class="autorefs autorefs-internal" href="#api-fdmath-meanas.fdmath.types.dx_lists_mut">list</a>[<a class="autorefs autorefs-internal" title="numpy.typing.NDArray" href="#numpy.typing.NDArray">NDArray</a>[<a class="autorefs autorefs-internal" title="numpy.float64" href="#numpy.float64">float64</a>]]]</code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Complex cell widths (dx_lists_mut) as discussed in <code>meanas.fdmath.types</code>.</p>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#api-fdmath-meanas.fdmath.types.dx_lists_mut">list</a>[<a class="autorefs autorefs-internal" href="#api-fdmath-meanas.fdmath.types.dx_lists_mut">list</a>[<a class="autorefs autorefs-internal" title="numpy.typing.NDArray" href="#numpy.typing.NDArray">NDArray</a>[<a class="autorefs autorefs-internal" title="numpy.float64" href="#numpy.float64">float64</a>]]]</code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Multiple calls to this function may be necessary if multiple absorpbing boundaries are needed.</p>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="doc doc-object doc-module">
|
|
|
|
|
|
|
|
<h2 id="api-fdfd-meanas.fdfd.farfield" class="doc doc-heading">
|
|
<code class="doc-symbol doc-symbol-heading doc-symbol-module"></code> <span class="doc doc-object-name doc-module-name">meanas.fdfd.farfield</span>
|
|
|
|
|
|
<a href="#api-fdfd-meanas.fdfd.farfield" class="headerlink" title="Permanent link">¶</a></h2>
|
|
|
|
<div class="doc doc-contents first">
|
|
|
|
<p>Functions for performing near-to-farfield transformation (and the reverse).</p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="doc doc-children">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="doc doc-object doc-function">
|
|
|
|
|
|
<h3 id="api-fdfd-meanas.fdfd.farfield.near_to_farfield" class="doc doc-heading">
|
|
<code class="doc-symbol doc-symbol-heading doc-symbol-function"></code> <span class="doc doc-object-name doc-function-name">near_to_farfield</span>
|
|
|
|
|
|
<a href="#api-fdfd-meanas.fdfd.farfield.near_to_farfield" class="headerlink" title="Permanent link">¶</a></h3>
|
|
<div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#api-fdfd-__codelineno-0-1"></a><span class="nf">near_to_farfield</span><span class="p">(</span>
|
|
<a id="__codelineno-0-2" name="__codelineno-0-2" href="#api-fdfd-__codelineno-0-2"></a> <span class="n">E_near</span><span class="p">:</span> <span class="n">cfdfield_t</span><span class="p">,</span>
|
|
<a id="__codelineno-0-3" name="__codelineno-0-3" href="#api-fdfd-__codelineno-0-3"></a> <span class="n">H_near</span><span class="p">:</span> <span class="n">cfdfield_t</span><span class="p">,</span>
|
|
<a id="__codelineno-0-4" name="__codelineno-0-4" href="#api-fdfd-__codelineno-0-4"></a> <span class="n">dx</span><span class="p">:</span> <span class="nb">float</span><span class="p">,</span>
|
|
<a id="__codelineno-0-5" name="__codelineno-0-5" href="#api-fdfd-__codelineno-0-5"></a> <span class="n">dy</span><span class="p">:</span> <span class="nb">float</span><span class="p">,</span>
|
|
<a id="__codelineno-0-6" name="__codelineno-0-6" href="#api-fdfd-__codelineno-0-6"></a> <span class="n">padded_size</span><span class="p">:</span> <span class="nb">list</span><span class="p">[</span><span class="nb">int</span><span class="p">]</span> <span class="o">|</span> <span class="nb">int</span> <span class="o">|</span> <span class="kc">None</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
|
|
<a id="__codelineno-0-7" name="__codelineno-0-7" href="#api-fdfd-__codelineno-0-7"></a><span class="p">)</span> <span class="o">-></span> <span class="nb">dict</span><span class="p">[</span><span class="nb">str</span><span class="p">,</span> <span class="n">Any</span><span class="p">]</span>
|
|
</code></pre></div>
|
|
|
|
<div class="doc doc-contents ">
|
|
|
|
<p>Compute the farfield, i.e. the distribution of the fields after propagation
|
|
through several wavelengths of uniform medium.</p>
|
|
<p>The input fields should be complex phasors.</p>
|
|
|
|
|
|
<p><span class="doc-section-title">Parameters:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
<th>Default</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>E_near</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title="meanas.fdmath.cfdfield_t" href="#meanas.fdmath.cfdfield_t">cfdfield_t</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>List of 2 ndarrays containing the 2D phasor field slices for the transverse
|
|
E fields (e.g. [Ex, Ey] for calculating the farfield toward the z-direction).</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>H_near</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title="meanas.fdmath.cfdfield_t" href="#meanas.fdmath.cfdfield_t">cfdfield_t</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>List of 2 ndarrays containing the 2D phasor field slices for the transverse
|
|
H fields (e.g. [Hx, hy] for calculating the farfield towrad the z-direction).</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>dx</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#float">float</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Cell size along x-dimension, in units of wavelength.</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>dy</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#float">float</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Cell size along y-dimension, in units of wavelength.</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>padded_size</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#api-fdmath-meanas.fdmath.types.dx_lists_mut">list</a>[<a class="autorefs autorefs-internal" href="#index-recommended-starting-points">int</a>] | <a class="autorefs autorefs-internal" href="#index-recommended-starting-points">int</a> | None</code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Shape of the output. A single integer <code>n</code> will be expanded to <code>(n, n)</code>.
|
|
Powers of 2 are most efficient for FFT computation.
|
|
Default is the smallest power of 2 larger than the input, for each axis.</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<code>None</code>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
<p><span class="doc-section-title">Returns:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#dict">dict</a>[<a class="autorefs autorefs-internal" href="#api-fdmath-meanas.fdmath--datastructure-dx_lists_t">str</a>, <a class="autorefs autorefs-internal" title="typing.Any" href="#typing.Any">Any</a>]</code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Dict with keys</p>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#dict">dict</a>[<a class="autorefs autorefs-internal" href="#api-fdmath-meanas.fdmath--datastructure-dx_lists_t">str</a>, <a class="autorefs autorefs-internal" title="typing.Any" href="#typing.Any">Any</a>]</code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<ul>
|
|
<li><code>E_far</code>: Normalized E-field farfield; multiply by
|
|
(i k exp(-i k r) / (4 pi r)) to get the actual field value.</li>
|
|
</ul>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#dict">dict</a>[<a class="autorefs autorefs-internal" href="#api-fdmath-meanas.fdmath--datastructure-dx_lists_t">str</a>, <a class="autorefs autorefs-internal" title="typing.Any" href="#typing.Any">Any</a>]</code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<ul>
|
|
<li><code>H_far</code>: Normalized H-field farfield; multiply by
|
|
(i k exp(-i k r) / (4 pi r)) to get the actual field value.</li>
|
|
</ul>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#dict">dict</a>[<a class="autorefs autorefs-internal" href="#api-fdmath-meanas.fdmath--datastructure-dx_lists_t">str</a>, <a class="autorefs autorefs-internal" title="typing.Any" href="#typing.Any">Any</a>]</code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<ul>
|
|
<li><code>kx</code>, <code>ky</code>: Wavevector values corresponding to the x- and y- axes in E_far and H_far,
|
|
normalized to wavelength (dimensionless).</li>
|
|
</ul>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#dict">dict</a>[<a class="autorefs autorefs-internal" href="#api-fdmath-meanas.fdmath--datastructure-dx_lists_t">str</a>, <a class="autorefs autorefs-internal" title="typing.Any" href="#typing.Any">Any</a>]</code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<ul>
|
|
<li><code>dkx</code>, <code>dky</code>: step size for kx and ky, normalized to wavelength.</li>
|
|
</ul>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#dict">dict</a>[<a class="autorefs autorefs-internal" href="#api-fdmath-meanas.fdmath--datastructure-dx_lists_t">str</a>, <a class="autorefs autorefs-internal" title="typing.Any" href="#typing.Any">Any</a>]</code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<ul>
|
|
<li><code>theta</code>: arctan2(ky, kx) corresponding to each (kx, ky).
|
|
This is the angle in the x-y plane, counterclockwise from above, starting from +x.</li>
|
|
</ul>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#dict">dict</a>[<a class="autorefs autorefs-internal" href="#api-fdmath-meanas.fdmath--datastructure-dx_lists_t">str</a>, <a class="autorefs autorefs-internal" title="typing.Any" href="#typing.Any">Any</a>]</code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<ul>
|
|
<li><code>phi</code>: arccos(kz / k) corresponding to each (kx, ky).
|
|
This is the angle away from +z.</li>
|
|
</ul>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="doc doc-object doc-function">
|
|
|
|
|
|
<h3 id="api-fdfd-meanas.fdfd.farfield.far_to_nearfield" class="doc doc-heading">
|
|
<code class="doc-symbol doc-symbol-heading doc-symbol-function"></code> <span class="doc doc-object-name doc-function-name">far_to_nearfield</span>
|
|
|
|
|
|
<a href="#api-fdfd-meanas.fdfd.farfield.far_to_nearfield" class="headerlink" title="Permanent link">¶</a></h3>
|
|
<div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#api-fdfd-__codelineno-0-1"></a><span class="nf">far_to_nearfield</span><span class="p">(</span>
|
|
<a id="__codelineno-0-2" name="__codelineno-0-2" href="#api-fdfd-__codelineno-0-2"></a> <span class="n">E_far</span><span class="p">:</span> <span class="n">cfdfield_t</span><span class="p">,</span>
|
|
<a id="__codelineno-0-3" name="__codelineno-0-3" href="#api-fdfd-__codelineno-0-3"></a> <span class="n">H_far</span><span class="p">:</span> <span class="n">cfdfield_t</span><span class="p">,</span>
|
|
<a id="__codelineno-0-4" name="__codelineno-0-4" href="#api-fdfd-__codelineno-0-4"></a> <span class="n">dkx</span><span class="p">:</span> <span class="nb">float</span><span class="p">,</span>
|
|
<a id="__codelineno-0-5" name="__codelineno-0-5" href="#api-fdfd-__codelineno-0-5"></a> <span class="n">dky</span><span class="p">:</span> <span class="nb">float</span><span class="p">,</span>
|
|
<a id="__codelineno-0-6" name="__codelineno-0-6" href="#api-fdfd-__codelineno-0-6"></a> <span class="n">padded_size</span><span class="p">:</span> <span class="nb">list</span><span class="p">[</span><span class="nb">int</span><span class="p">]</span> <span class="o">|</span> <span class="nb">int</span> <span class="o">|</span> <span class="kc">None</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
|
|
<a id="__codelineno-0-7" name="__codelineno-0-7" href="#api-fdfd-__codelineno-0-7"></a><span class="p">)</span> <span class="o">-></span> <span class="nb">dict</span><span class="p">[</span><span class="nb">str</span><span class="p">,</span> <span class="n">Any</span><span class="p">]</span>
|
|
</code></pre></div>
|
|
|
|
<div class="doc doc-contents ">
|
|
|
|
<p>Compute the farfield, i.e. the distribution of the fields after propagation
|
|
through several wavelengths of uniform medium.</p>
|
|
<p>The input fields should be complex phasors.</p>
|
|
|
|
|
|
<p><span class="doc-section-title">Parameters:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
<th>Default</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>E_far</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title="meanas.fdmath.cfdfield_t" href="#meanas.fdmath.cfdfield_t">cfdfield_t</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>List of 2 ndarrays containing the 2D phasor field slices for the transverse
|
|
E fields (e.g. [Ex, Ey] for calculating the nearfield toward the z-direction).
|
|
Fields should be normalized so that
|
|
E_far = E_far_actual / (i k exp(-i k r) / (4 pi r))</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>H_far</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title="meanas.fdmath.cfdfield_t" href="#meanas.fdmath.cfdfield_t">cfdfield_t</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>List of 2 ndarrays containing the 2D phasor field slices for the transverse
|
|
H fields (e.g. [Hx, hy] for calculating the nearfield toward the z-direction).
|
|
Fields should be normalized so that
|
|
H_far = H_far_actual / (i k exp(-i k r) / (4 pi r))</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>dkx</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#float">float</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>kx discretization, in units of wavelength.</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>dky</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#float">float</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>ky discretization, in units of wavelength.</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>padded_size</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#api-fdmath-meanas.fdmath.types.dx_lists_mut">list</a>[<a class="autorefs autorefs-internal" href="#index-recommended-starting-points">int</a>] | <a class="autorefs autorefs-internal" href="#index-recommended-starting-points">int</a> | None</code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Shape of the output. A single integer <code>n</code> will be expanded to <code>(n, n)</code>.
|
|
Powers of 2 are most efficient for FFT computation.
|
|
Default is the smallest power of 2 larger than the input, for each axis.</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<code>None</code>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
<p><span class="doc-section-title">Returns:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#dict">dict</a>[<a class="autorefs autorefs-internal" href="#api-fdmath-meanas.fdmath--datastructure-dx_lists_t">str</a>, <a class="autorefs autorefs-internal" title="typing.Any" href="#typing.Any">Any</a>]</code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Dict with keys</p>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#dict">dict</a>[<a class="autorefs autorefs-internal" href="#api-fdmath-meanas.fdmath--datastructure-dx_lists_t">str</a>, <a class="autorefs autorefs-internal" title="typing.Any" href="#typing.Any">Any</a>]</code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<ul>
|
|
<li><code>E</code>: E-field nearfield</li>
|
|
</ul>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#dict">dict</a>[<a class="autorefs autorefs-internal" href="#api-fdmath-meanas.fdmath--datastructure-dx_lists_t">str</a>, <a class="autorefs autorefs-internal" title="typing.Any" href="#typing.Any">Any</a>]</code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<ul>
|
|
<li><code>H</code>: H-field nearfield</li>
|
|
</ul>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#dict">dict</a>[<a class="autorefs autorefs-internal" href="#api-fdmath-meanas.fdmath--datastructure-dx_lists_t">str</a>, <a class="autorefs autorefs-internal" title="typing.Any" href="#typing.Any">Any</a>]</code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<ul>
|
|
<li><code>dx</code>, <code>dy</code>: spatial discretization, normalized to wavelength (dimensionless)</li>
|
|
</ul>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div></section><section class="print-page" id="api-waveguides" heading-number="2.5"><h1 id="api-waveguides-waveguides">waveguides<a class="headerlink" href="#api-waveguides-waveguides" title="Permanent link">¶</a></h1>
|
|
|
|
|
|
<div class="doc doc-object doc-module">
|
|
|
|
|
|
|
|
<h2 id="api-waveguides-meanas.fdfd.waveguide_2d" class="doc doc-heading">
|
|
<code class="doc-symbol doc-symbol-heading doc-symbol-module"></code> <span class="doc doc-object-name doc-module-name">meanas.fdfd.waveguide_2d</span>
|
|
|
|
|
|
<a href="#api-waveguides-meanas.fdfd.waveguide_2d" class="headerlink" title="Permanent link">¶</a></h2>
|
|
|
|
<div class="doc doc-contents first">
|
|
|
|
<p>Operators and helper functions for waveguides with unchanging cross-section.</p>
|
|
<p>The propagation direction is chosen to be along the z axis, and all fields
|
|
are given an implicit z-dependence of the form <code>exp(-1 * wavenumber * z)</code>.</p>
|
|
<p>As the z-dependence is known, all the functions in this file assume a 2D grid
|
|
(i.e. <code>dxes = [[[dx_e[0], dx_e[1], ...], [dy_e[0], ...]], [[dx_h[0], ...], [dy_h[0], ...]]]</code>).</p>
|
|
<p>===============</p>
|
|
<p>Consider Maxwell's equations in continuous space, in the frequency domain. Assuming
|
|
a structure with some (x, y) cross-section extending uniformly into the z dimension,
|
|
with a diagonal <span class="arithmatex">\(\epsilon\)</span> tensor, we have</p>
|
|
<div class="arithmatex">\[
|
|
\begin{aligned}
|
|
\nabla \times \vec{E}(x, y, z) &= -\imath \omega \mu \vec{H} \\
|
|
\nabla \times \vec{H}(x, y, z) &= \imath \omega \epsilon \vec{E} \\
|
|
\vec{E}(x,y,z) &= (\vec{E}_t(x, y) + E_z(x, y)\vec{z}) e^{-\imath \beta z} \\
|
|
\vec{H}(x,y,z) &= (\vec{H}_t(x, y) + H_z(x, y)\vec{z}) e^{-\imath \beta z} \\
|
|
\end{aligned}
|
|
\]</div>
|
|
<p>Expanding the first two equations into vector components, we get</p>
|
|
<div class="arithmatex">\[
|
|
\begin{aligned}
|
|
-\imath \omega \mu_{xx} H_x &= \partial_y E_z - \partial_z E_y \\
|
|
-\imath \omega \mu_{yy} H_y &= \partial_z E_x - \partial_x E_z \\
|
|
-\imath \omega \mu_{zz} H_z &= \partial_x E_y - \partial_y E_x \\
|
|
\imath \omega \epsilon_{xx} E_x &= \partial_y H_z - \partial_z H_y \\
|
|
\imath \omega \epsilon_{yy} E_y &= \partial_z H_x - \partial_x H_z \\
|
|
\imath \omega \epsilon_{zz} E_z &= \partial_x H_y - \partial_y H_x \\
|
|
\end{aligned}
|
|
\]</div>
|
|
<p>Substituting in our expressions for <span class="arithmatex">\(\vec{E}\)</span>, <span class="arithmatex">\(\vec{H}\)</span> and discretizing:</p>
|
|
<div class="arithmatex">\[
|
|
\begin{aligned}
|
|
-\imath \omega \mu_{xx} H_x &= \tilde{\partial}_y E_z + \imath \beta E_y \\
|
|
-\imath \omega \mu_{yy} H_y &= -\imath \beta E_x - \tilde{\partial}_x E_z \\
|
|
-\imath \omega \mu_{zz} H_z &= \tilde{\partial}_x E_y - \tilde{\partial}_y E_x \\
|
|
\imath \omega \epsilon_{xx} E_x &= \hat{\partial}_y H_z + \imath \beta H_y \\
|
|
\imath \omega \epsilon_{yy} E_y &= -\imath \beta H_x - \hat{\partial}_x H_z \\
|
|
\imath \omega \epsilon_{zz} E_z &= \hat{\partial}_x H_y - \hat{\partial}_y H_x \\
|
|
\end{aligned}
|
|
\]</div>
|
|
<p>Rewrite the last three equations as</p>
|
|
<div class="arithmatex">\[
|
|
\begin{aligned}
|
|
\imath \beta H_y &= \imath \omega \epsilon_{xx} E_x - \hat{\partial}_y H_z \\
|
|
\imath \beta H_x &= -\imath \omega \epsilon_{yy} E_y - \hat{\partial}_x H_z \\
|
|
\imath \omega E_z &= \frac{1}{\epsilon_{zz}} \hat{\partial}_x H_y - \frac{1}{\epsilon_{zz}} \hat{\partial}_y H_x \\
|
|
\end{aligned}
|
|
\]</div>
|
|
<p>Now apply <span class="arithmatex">\(\imath \beta \tilde{\partial}_x\)</span> to the last equation,
|
|
then substitute in for <span class="arithmatex">\(\imath \beta H_x\)</span> and <span class="arithmatex">\(\imath \beta H_y\)</span>:</p>
|
|
<div class="arithmatex">\[
|
|
\begin{aligned}
|
|
\imath \beta \tilde{\partial}_x \imath \omega E_z &= \imath \beta \tilde{\partial}_x \frac{1}{\epsilon_{zz}} \hat{\partial}_x H_y
|
|
- \imath \beta \tilde{\partial}_x \frac{1}{\epsilon_{zz}} \hat{\partial}_y H_x \\
|
|
&= \tilde{\partial}_x \frac{1}{\epsilon_{zz}} \hat{\partial}_x ( \imath \omega \epsilon_{xx} E_x - \hat{\partial}_y H_z)
|
|
- \tilde{\partial}_x \frac{1}{\epsilon_{zz}} \hat{\partial}_y (-\imath \omega \epsilon_{yy} E_y - \hat{\partial}_x H_z) \\
|
|
&= \tilde{\partial}_x \frac{1}{\epsilon_{zz}} \hat{\partial}_x ( \imath \omega \epsilon_{xx} E_x)
|
|
- \tilde{\partial}_x \frac{1}{\epsilon_{zz}} \hat{\partial}_y (-\imath \omega \epsilon_{yy} E_y) \\
|
|
\imath \beta \tilde{\partial}_x E_z &= \tilde{\partial}_x \frac{1}{\epsilon_{zz}} \hat{\partial}_x (\epsilon_{xx} E_x)
|
|
+ \tilde{\partial}_x \frac{1}{\epsilon_{zz}} \hat{\partial}_y (\epsilon_{yy} E_y) \\
|
|
\end{aligned}
|
|
\]</div>
|
|
<p>With a similar approach (but using <span class="arithmatex">\(\imath \beta \tilde{\partial}_y\)</span> instead), we can get</p>
|
|
<div class="arithmatex">\[
|
|
\begin{aligned}
|
|
\imath \beta \tilde{\partial}_y E_z &= \tilde{\partial}_y \frac{1}{\epsilon_{zz}} \hat{\partial}_x (\epsilon_{xx} E_x)
|
|
+ \tilde{\partial}_y \frac{1}{\epsilon_{zz}} \hat{\partial}_y (\epsilon_{yy} E_y) \\
|
|
\end{aligned}
|
|
\]</div>
|
|
<p>We can combine this equation for <span class="arithmatex">\(\imath \beta \tilde{\partial}_y E_z\)</span> with
|
|
the unused <span class="arithmatex">\(\imath \omega \mu_{xx} H_x\)</span> and <span class="arithmatex">\(\imath \omega \mu_{yy} H_y\)</span> equations to get</p>
|
|
<div class="arithmatex">\[
|
|
\begin{aligned}
|
|
-\imath \omega \mu_{xx} \imath \beta H_x &= -\beta^2 E_y + \imath \beta \tilde{\partial}_y E_z \\
|
|
-\imath \omega \mu_{xx} \imath \beta H_x &= -\beta^2 E_y + \tilde{\partial}_y (
|
|
\frac{1}{\epsilon_{zz}} \hat{\partial}_x (\epsilon_{xx} E_x)
|
|
+ \frac{1}{\epsilon_{zz}} \hat{\partial}_y (\epsilon_{yy} E_y)
|
|
)\\
|
|
\end{aligned}
|
|
\]</div>
|
|
<p>and</p>
|
|
<div class="arithmatex">\[
|
|
\begin{aligned}
|
|
-\imath \omega \mu_{yy} \imath \beta H_y &= \beta^2 E_x - \imath \beta \tilde{\partial}_x E_z \\
|
|
-\imath \omega \mu_{yy} \imath \beta H_y &= \beta^2 E_x - \tilde{\partial}_x (
|
|
\frac{1}{\epsilon_{zz}} \hat{\partial}_x (\epsilon_{xx} E_x)
|
|
+ \frac{1}{\epsilon_{zz}} \hat{\partial}_y (\epsilon_{yy} E_y)
|
|
)\\
|
|
\end{aligned}
|
|
\]</div>
|
|
<p>However, based on our rewritten equation for <span class="arithmatex">\(\imath \beta H_x\)</span> and the so-far unused
|
|
equation for <span class="arithmatex">\(\imath \omega \mu_{zz} H_z\)</span> we can also write</p>
|
|
<div class="arithmatex">\[
|
|
\begin{aligned}
|
|
-\imath \omega \mu_{xx} (\imath \beta H_x) &= -\imath \omega \mu_{xx} (-\imath \omega \epsilon_{yy} E_y - \hat{\partial}_x H_z) \\
|
|
&= -\omega^2 \mu_{xx} \epsilon_{yy} E_y + \imath \omega \mu_{xx} \hat{\partial}_x (
|
|
\frac{1}{-\imath \omega \mu_{zz}} (\tilde{\partial}_x E_y - \tilde{\partial}_y E_x)) \\
|
|
&= -\omega^2 \mu_{xx} \epsilon_{yy} E_y
|
|
-\mu_{xx} \hat{\partial}_x \frac{1}{\mu_{zz}} (\tilde{\partial}_x E_y - \tilde{\partial}_y E_x) \\
|
|
\end{aligned}
|
|
\]</div>
|
|
<p>and, similarly,</p>
|
|
<div class="arithmatex">\[
|
|
\begin{aligned}
|
|
-\imath \omega \mu_{yy} (\imath \beta H_y) &= \omega^2 \mu_{yy} \epsilon_{xx} E_x
|
|
+\mu_{yy} \hat{\partial}_y \frac{1}{\mu_{zz}} (\tilde{\partial}_x E_y - \tilde{\partial}_y E_x) \\
|
|
\end{aligned}
|
|
\]</div>
|
|
<p>By combining both pairs of expressions, we get</p>
|
|
<div class="arithmatex">\[
|
|
\begin{aligned}
|
|
\beta^2 E_x - \tilde{\partial}_x (
|
|
\frac{1}{\epsilon_{zz}} \hat{\partial}_x (\epsilon_{xx} E_x)
|
|
+ \frac{1}{\epsilon_{zz}} \hat{\partial}_y (\epsilon_{yy} E_y)
|
|
) &= \omega^2 \mu_{yy} \epsilon_{xx} E_x
|
|
+\mu_{yy} \hat{\partial}_y \frac{1}{\mu_{zz}} (\tilde{\partial}_x E_y - \tilde{\partial}_y E_x) \\
|
|
-\beta^2 E_y + \tilde{\partial}_y (
|
|
\frac{1}{\epsilon_{zz}} \hat{\partial}_x (\epsilon_{xx} E_x)
|
|
+ \frac{1}{\epsilon_{zz}} \hat{\partial}_y (\epsilon_{yy} E_y)
|
|
) &= -\omega^2 \mu_{xx} \epsilon_{yy} E_y
|
|
-\mu_{xx} \hat{\partial}_x \frac{1}{\mu_{zz}} (\tilde{\partial}_x E_y - \tilde{\partial}_y E_x) \\
|
|
\end{aligned}
|
|
\]</div>
|
|
<p>Using these, we can construct the eigenvalue problem</p>
|
|
<div class="arithmatex">\[
|
|
\beta^2 \begin{bmatrix} E_x \\
|
|
E_y \end{bmatrix} =
|
|
(\omega^2 \begin{bmatrix} \mu_{yy} \epsilon_{xx} & 0 \\
|
|
0 & \mu_{xx} \epsilon_{yy} \end{bmatrix} +
|
|
\begin{bmatrix} -\mu_{yy} \hat{\partial}_y \\
|
|
\mu_{xx} \hat{\partial}_x \end{bmatrix} \mu_{zz}^{-1}
|
|
\begin{bmatrix} -\tilde{\partial}_y & \tilde{\partial}_x \end{bmatrix} +
|
|
\begin{bmatrix} \tilde{\partial}_x \\
|
|
\tilde{\partial}_y \end{bmatrix} \epsilon_{zz}^{-1}
|
|
\begin{bmatrix} \hat{\partial}_x \epsilon_{xx} & \hat{\partial}_y \epsilon_{yy} \end{bmatrix})
|
|
\begin{bmatrix} E_x \\
|
|
E_y \end{bmatrix}
|
|
\]</div>
|
|
<p>In the literature, <span class="arithmatex">\(\beta\)</span> is usually used to denote the lossless/real part of the propagation constant,
|
|
but in <code>meanas</code> it is allowed to be complex.</p>
|
|
<p>An equivalent eigenvalue problem can be formed using the <span class="arithmatex">\(H_x\)</span> and <span class="arithmatex">\(H_y\)</span> fields, if those are more convenient.</p>
|
|
<p>Note that <span class="arithmatex">\(E_z\)</span> was never discretized, so <span class="arithmatex">\(\beta\)</span> will need adjustment to account for numerical dispersion
|
|
if the result is introduced into a space with a discretized z-axis.</p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="doc doc-children">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="doc doc-object doc-function">
|
|
|
|
|
|
<h3 id="api-waveguides-meanas.fdfd.waveguide_2d.operator_e" class="doc doc-heading">
|
|
<code class="doc-symbol doc-symbol-heading doc-symbol-function"></code> <span class="doc doc-object-name doc-function-name">operator_e</span>
|
|
|
|
|
|
<a href="#api-waveguides-meanas.fdfd.waveguide_2d.operator_e" class="headerlink" title="Permanent link">¶</a></h3>
|
|
<div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#api-waveguides-__codelineno-0-1"></a><span class="nf">operator_e</span><span class="p">(</span>
|
|
<a id="__codelineno-0-2" name="__codelineno-0-2" href="#api-waveguides-__codelineno-0-2"></a> <span class="n">omega</span><span class="p">:</span> <span class="nb">complex</span><span class="p">,</span>
|
|
<a id="__codelineno-0-3" name="__codelineno-0-3" href="#api-waveguides-__codelineno-0-3"></a> <span class="n">dxes</span><span class="p">:</span> <span class="n">dx_lists2_t</span><span class="p">,</span>
|
|
<a id="__codelineno-0-4" name="__codelineno-0-4" href="#api-waveguides-__codelineno-0-4"></a> <span class="n">epsilon</span><span class="p">:</span> <span class="n">vfdslice</span><span class="p">,</span>
|
|
<a id="__codelineno-0-5" name="__codelineno-0-5" href="#api-waveguides-__codelineno-0-5"></a> <span class="n">mu</span><span class="p">:</span> <span class="n">vfdslice</span> <span class="o">|</span> <span class="kc">None</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
|
|
<a id="__codelineno-0-6" name="__codelineno-0-6" href="#api-waveguides-__codelineno-0-6"></a><span class="p">)</span> <span class="o">-></span> <span class="n">sparse</span><span class="o">.</span><span class="n">sparray</span>
|
|
</code></pre></div>
|
|
|
|
<div class="doc doc-contents ">
|
|
|
|
<p>Waveguide operator of the form</p>
|
|
<div class="highlight"><pre><span></span><code>omega**2 * mu * epsilon +
|
|
mu * [[-Dy], [Dx]] / mu * [-Dy, Dx] +
|
|
[[Dx], [Dy]] / epsilon * [Dx, Dy] * epsilon
|
|
</code></pre></div>
|
|
<p>for use with a field vector of the form <code>cat([E_x, E_y])</code>.</p>
|
|
<p>More precisely, the operator is</p>
|
|
<div class="arithmatex">\[
|
|
\omega^2 \begin{bmatrix} \mu_{yy} \epsilon_{xx} & 0 \\
|
|
0 & \mu_{xx} \epsilon_{yy} \end{bmatrix} +
|
|
\begin{bmatrix} -\mu_{yy} \hat{\partial}_y \\
|
|
\mu_{xx} \hat{\partial}_x \end{bmatrix} \mu_{zz}^{-1}
|
|
\begin{bmatrix} -\tilde{\partial}_y & \tilde{\partial}_x \end{bmatrix} +
|
|
\begin{bmatrix} \tilde{\partial}_x \\
|
|
\tilde{\partial}_y \end{bmatrix} \epsilon_{zz}^{-1}
|
|
\begin{bmatrix} \hat{\partial}_x \epsilon_{xx} & \hat{\partial}_y \epsilon_{yy} \end{bmatrix}
|
|
\]</div>
|
|
<p><span class="arithmatex">\(\tilde{\partial}_x\)</span> and <span class="arithmatex">\(\hat{\partial}_x\)</span> are the forward and backward derivatives along x,
|
|
and each <span class="arithmatex">\(\epsilon_{xx}\)</span>, <span class="arithmatex">\(\mu_{yy}\)</span>, etc. is a diagonal matrix containing the vectorized material
|
|
property distribution.</p>
|
|
<p>This operator can be used to form an eigenvalue problem of the form
|
|
<code>operator_e(...) @ [E_x, E_y] = wavenumber**2 * [E_x, E_y]</code></p>
|
|
<p>which can then be solved for the eigenmodes of the system (an <code>exp(-i * wavenumber * z)</code>
|
|
z-dependence is assumed for the fields).</p>
|
|
|
|
|
|
<p><span class="doc-section-title">Parameters:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
<th>Default</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>omega</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#complex">complex</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>The angular frequency of the system.</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>dxes</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" dx_lists2_t
|
|
|
|
|
|
|
|
module-attribute
|
|
(meanas.fdmath.dx_lists2_t)" href="#api-fdmath-meanas.fdmath.types.dx_lists2_t">dx_lists2_t</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Grid parameters <code>[dx_e, dx_h]</code> as described in <code>meanas.fdmath.types</code> (2D)</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>epsilon</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" vfdslice (meanas.fdmath.vfdslice)" href="#api-fdmath-meanas.fdmath.types.vfdslice">vfdslice</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Vectorized dielectric constant grid</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>mu</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" vfdslice (meanas.fdmath.vfdslice)" href="#api-fdmath-meanas.fdmath.types.vfdslice">vfdslice</a> | None</code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Vectorized magnetic permeability grid (default 1 everywhere)</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<code>None</code>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
<p><span class="doc-section-title">Returns:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title="scipy.sparse.sparray" href="#scipy.sparse.sparray">sparray</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Sparse matrix representation of the operator.</p>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="doc doc-object doc-function">
|
|
|
|
|
|
<h3 id="api-waveguides-meanas.fdfd.waveguide_2d.operator_h" class="doc doc-heading">
|
|
<code class="doc-symbol doc-symbol-heading doc-symbol-function"></code> <span class="doc doc-object-name doc-function-name">operator_h</span>
|
|
|
|
|
|
<a href="#api-waveguides-meanas.fdfd.waveguide_2d.operator_h" class="headerlink" title="Permanent link">¶</a></h3>
|
|
<div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#api-waveguides-__codelineno-0-1"></a><span class="nf">operator_h</span><span class="p">(</span>
|
|
<a id="__codelineno-0-2" name="__codelineno-0-2" href="#api-waveguides-__codelineno-0-2"></a> <span class="n">omega</span><span class="p">:</span> <span class="nb">complex</span><span class="p">,</span>
|
|
<a id="__codelineno-0-3" name="__codelineno-0-3" href="#api-waveguides-__codelineno-0-3"></a> <span class="n">dxes</span><span class="p">:</span> <span class="n">dx_lists2_t</span><span class="p">,</span>
|
|
<a id="__codelineno-0-4" name="__codelineno-0-4" href="#api-waveguides-__codelineno-0-4"></a> <span class="n">epsilon</span><span class="p">:</span> <span class="n">vfdslice</span><span class="p">,</span>
|
|
<a id="__codelineno-0-5" name="__codelineno-0-5" href="#api-waveguides-__codelineno-0-5"></a> <span class="n">mu</span><span class="p">:</span> <span class="n">vfdslice</span> <span class="o">|</span> <span class="kc">None</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
|
|
<a id="__codelineno-0-6" name="__codelineno-0-6" href="#api-waveguides-__codelineno-0-6"></a><span class="p">)</span> <span class="o">-></span> <span class="n">sparse</span><span class="o">.</span><span class="n">sparray</span>
|
|
</code></pre></div>
|
|
|
|
<div class="doc doc-contents ">
|
|
|
|
<p>Waveguide operator of the form</p>
|
|
<div class="highlight"><pre><span></span><code>omega**2 * epsilon * mu +
|
|
epsilon * [[-Dy], [Dx]] / epsilon * [-Dy, Dx] +
|
|
[[Dx], [Dy]] / mu * [Dx, Dy] * mu
|
|
</code></pre></div>
|
|
<p>for use with a field vector of the form <code>cat([H_x, H_y])</code>.</p>
|
|
<p>More precisely, the operator is</p>
|
|
<div class="arithmatex">\[
|
|
\omega^2 \begin{bmatrix} \epsilon_{yy} \mu_{xx} & 0 \\
|
|
0 & \epsilon_{xx} \mu_{yy} \end{bmatrix} +
|
|
\begin{bmatrix} -\epsilon_{yy} \tilde{\partial}_y \\
|
|
\epsilon_{xx} \tilde{\partial}_x \end{bmatrix} \epsilon_{zz}^{-1}
|
|
\begin{bmatrix} -\hat{\partial}_y & \hat{\partial}_x \end{bmatrix} +
|
|
\begin{bmatrix} \hat{\partial}_x \\
|
|
\hat{\partial}_y \end{bmatrix} \mu_{zz}^{-1}
|
|
\begin{bmatrix} \tilde{\partial}_x \mu_{xx} & \tilde{\partial}_y \mu_{yy} \end{bmatrix}
|
|
\]</div>
|
|
<p><span class="arithmatex">\(\tilde{\partial}_x\)</span> and <span class="arithmatex">\(\hat{\partial}_x\)</span> are the forward and backward derivatives along x,
|
|
and each <span class="arithmatex">\(\epsilon_{xx}\)</span>, <span class="arithmatex">\(\mu_{yy}\)</span>, etc. is a diagonal matrix containing the vectorized material
|
|
property distribution.</p>
|
|
<p>This operator can be used to form an eigenvalue problem of the form
|
|
<code>operator_h(...) @ [H_x, H_y] = wavenumber**2 * [H_x, H_y]</code></p>
|
|
<p>which can then be solved for the eigenmodes of the system (an <code>exp(-i * wavenumber * z)</code>
|
|
z-dependence is assumed for the fields).</p>
|
|
|
|
|
|
<p><span class="doc-section-title">Parameters:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
<th>Default</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>omega</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#complex">complex</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>The angular frequency of the system.</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>dxes</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" dx_lists2_t
|
|
|
|
|
|
|
|
module-attribute
|
|
(meanas.fdmath.dx_lists2_t)" href="#api-fdmath-meanas.fdmath.types.dx_lists2_t">dx_lists2_t</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Grid parameters <code>[dx_e, dx_h]</code> as described in <code>meanas.fdmath.types</code> (2D)</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>epsilon</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" vfdslice (meanas.fdmath.vfdslice)" href="#api-fdmath-meanas.fdmath.types.vfdslice">vfdslice</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Vectorized dielectric constant grid</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>mu</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" vfdslice (meanas.fdmath.vfdslice)" href="#api-fdmath-meanas.fdmath.types.vfdslice">vfdslice</a> | None</code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Vectorized magnetic permeability grid (default 1 everywhere)</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<code>None</code>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
<p><span class="doc-section-title">Returns:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title="scipy.sparse.sparray" href="#scipy.sparse.sparray">sparray</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Sparse matrix representation of the operator.</p>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="doc doc-object doc-function">
|
|
|
|
|
|
<h3 id="api-waveguides-meanas.fdfd.waveguide_2d.normalized_fields_e" class="doc doc-heading">
|
|
<code class="doc-symbol doc-symbol-heading doc-symbol-function"></code> <span class="doc doc-object-name doc-function-name">normalized_fields_e</span>
|
|
|
|
|
|
<a href="#api-waveguides-meanas.fdfd.waveguide_2d.normalized_fields_e" class="headerlink" title="Permanent link">¶</a></h3>
|
|
<div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#api-waveguides-__codelineno-0-1"></a><span class="nf">normalized_fields_e</span><span class="p">(</span>
|
|
<a id="__codelineno-0-2" name="__codelineno-0-2" href="#api-waveguides-__codelineno-0-2"></a> <span class="n">e_xy</span><span class="p">:</span> <span class="n">vcfdfield2</span><span class="p">,</span>
|
|
<a id="__codelineno-0-3" name="__codelineno-0-3" href="#api-waveguides-__codelineno-0-3"></a> <span class="n">wavenumber</span><span class="p">:</span> <span class="nb">complex</span><span class="p">,</span>
|
|
<a id="__codelineno-0-4" name="__codelineno-0-4" href="#api-waveguides-__codelineno-0-4"></a> <span class="n">omega</span><span class="p">:</span> <span class="nb">complex</span><span class="p">,</span>
|
|
<a id="__codelineno-0-5" name="__codelineno-0-5" href="#api-waveguides-__codelineno-0-5"></a> <span class="n">dxes</span><span class="p">:</span> <span class="n">dx_lists2_t</span><span class="p">,</span>
|
|
<a id="__codelineno-0-6" name="__codelineno-0-6" href="#api-waveguides-__codelineno-0-6"></a> <span class="n">epsilon</span><span class="p">:</span> <span class="n">vfdslice</span><span class="p">,</span>
|
|
<a id="__codelineno-0-7" name="__codelineno-0-7" href="#api-waveguides-__codelineno-0-7"></a> <span class="n">mu</span><span class="p">:</span> <span class="n">vfdslice</span> <span class="o">|</span> <span class="kc">None</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
|
|
<a id="__codelineno-0-8" name="__codelineno-0-8" href="#api-waveguides-__codelineno-0-8"></a> <span class="n">prop_phase</span><span class="p">:</span> <span class="nb">float</span> <span class="o">=</span> <span class="mi">0</span><span class="p">,</span>
|
|
<a id="__codelineno-0-9" name="__codelineno-0-9" href="#api-waveguides-__codelineno-0-9"></a><span class="p">)</span> <span class="o">-></span> <span class="nb">tuple</span><span class="p">[</span><span class="n">vcfdslice_t</span><span class="p">,</span> <span class="n">vcfdslice_t</span><span class="p">]</span>
|
|
</code></pre></div>
|
|
|
|
<div class="doc doc-contents ">
|
|
|
|
<p>Given a vector <code>e_xy</code> containing the vectorized E_x and E_y fields,
|
|
returns normalized, vectorized E and H fields for the system.</p>
|
|
|
|
|
|
<p><span class="doc-section-title">Parameters:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
<th>Default</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>e_xy</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" vcfdfield2 (meanas.fdmath.vcfdfield2)" href="#api-fdmath-meanas.fdmath.types.vcfdfield2">vcfdfield2</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Vector containing E_x and E_y fields</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>wavenumber</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#complex">complex</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Wavenumber assuming fields have z-dependence of <code>exp(-i * wavenumber * z)</code>.
|
|
It should satisfy <code>operator_e() @ e_xy == wavenumber**2 * e_xy</code></p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>omega</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#complex">complex</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>The angular frequency of the system</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>dxes</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" dx_lists2_t
|
|
|
|
|
|
|
|
module-attribute
|
|
(meanas.fdmath.dx_lists2_t)" href="#api-fdmath-meanas.fdmath.types.dx_lists2_t">dx_lists2_t</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Grid parameters <code>[dx_e, dx_h]</code> as described in <code>meanas.fdmath.types</code> (2D)</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>epsilon</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" vfdslice (meanas.fdmath.vfdslice)" href="#api-fdmath-meanas.fdmath.types.vfdslice">vfdslice</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Vectorized dielectric constant grid</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>mu</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" vfdslice (meanas.fdmath.vfdslice)" href="#api-fdmath-meanas.fdmath.types.vfdslice">vfdslice</a> | None</code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Vectorized magnetic permeability grid (default 1 everywhere)</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<code>None</code>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>prop_phase</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#float">float</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Phase shift <code>(dz * corrected_wavenumber)</code> over 1 cell in propagation direction.
|
|
Default 0 (continuous propagation direction, i.e. dz->0).</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<code>0</code>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
<p><span class="doc-section-title">Returns:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title="meanas.fdmath.vcfdslice_t" href="#meanas.fdmath.vcfdslice_t">vcfdslice_t</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p><code>(e, h)</code>, where each field is vectorized, normalized,</p>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title="meanas.fdmath.vcfdslice_t" href="#meanas.fdmath.vcfdslice_t">vcfdslice_t</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>and contains all three vector components.</p>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
<details class="notes" open>
|
|
<summary>Notes</summary>
|
|
<p><code>e_xy</code> is only the transverse electric eigenvector. This helper first
|
|
reconstructs the full three-component <code>E</code> and <code>H</code> fields with <code>exy2e(...)</code>
|
|
and <code>exy2h(...)</code>, then normalizes them to unit forward power using
|
|
<code>_normalized_fields(...)</code>.</p>
|
|
<p>The normalization target is</p>
|
|
<div class="arithmatex">\[
|
|
\Re\left[\mathrm{inner\_product}(e, h, \mathrm{conj\_h}=True)\right] = 1,
|
|
\]</div>
|
|
<p>so the returned fields represent a unit-power forward mode under the
|
|
discrete Yee-grid Poynting inner product.</p>
|
|
</details>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="doc doc-object doc-function">
|
|
|
|
|
|
<h3 id="api-waveguides-meanas.fdfd.waveguide_2d.normalized_fields_h" class="doc doc-heading">
|
|
<code class="doc-symbol doc-symbol-heading doc-symbol-function"></code> <span class="doc doc-object-name doc-function-name">normalized_fields_h</span>
|
|
|
|
|
|
<a href="#api-waveguides-meanas.fdfd.waveguide_2d.normalized_fields_h" class="headerlink" title="Permanent link">¶</a></h3>
|
|
<div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#api-waveguides-__codelineno-0-1"></a><span class="nf">normalized_fields_h</span><span class="p">(</span>
|
|
<a id="__codelineno-0-2" name="__codelineno-0-2" href="#api-waveguides-__codelineno-0-2"></a> <span class="n">h_xy</span><span class="p">:</span> <span class="n">vcfdfield2</span><span class="p">,</span>
|
|
<a id="__codelineno-0-3" name="__codelineno-0-3" href="#api-waveguides-__codelineno-0-3"></a> <span class="n">wavenumber</span><span class="p">:</span> <span class="nb">complex</span><span class="p">,</span>
|
|
<a id="__codelineno-0-4" name="__codelineno-0-4" href="#api-waveguides-__codelineno-0-4"></a> <span class="n">omega</span><span class="p">:</span> <span class="nb">complex</span><span class="p">,</span>
|
|
<a id="__codelineno-0-5" name="__codelineno-0-5" href="#api-waveguides-__codelineno-0-5"></a> <span class="n">dxes</span><span class="p">:</span> <span class="n">dx_lists2_t</span><span class="p">,</span>
|
|
<a id="__codelineno-0-6" name="__codelineno-0-6" href="#api-waveguides-__codelineno-0-6"></a> <span class="n">epsilon</span><span class="p">:</span> <span class="n">vfdslice</span><span class="p">,</span>
|
|
<a id="__codelineno-0-7" name="__codelineno-0-7" href="#api-waveguides-__codelineno-0-7"></a> <span class="n">mu</span><span class="p">:</span> <span class="n">vfdslice</span> <span class="o">|</span> <span class="kc">None</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
|
|
<a id="__codelineno-0-8" name="__codelineno-0-8" href="#api-waveguides-__codelineno-0-8"></a> <span class="n">prop_phase</span><span class="p">:</span> <span class="nb">float</span> <span class="o">=</span> <span class="mi">0</span><span class="p">,</span>
|
|
<a id="__codelineno-0-9" name="__codelineno-0-9" href="#api-waveguides-__codelineno-0-9"></a><span class="p">)</span> <span class="o">-></span> <span class="nb">tuple</span><span class="p">[</span><span class="n">vcfdslice_t</span><span class="p">,</span> <span class="n">vcfdslice_t</span><span class="p">]</span>
|
|
</code></pre></div>
|
|
|
|
<div class="doc doc-contents ">
|
|
|
|
<p>Given a vector <code>h_xy</code> containing the vectorized H_x and H_y fields,
|
|
returns normalized, vectorized E and H fields for the system.</p>
|
|
|
|
|
|
<p><span class="doc-section-title">Parameters:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
<th>Default</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>h_xy</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" vcfdfield2 (meanas.fdmath.vcfdfield2)" href="#api-fdmath-meanas.fdmath.types.vcfdfield2">vcfdfield2</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Vector containing H_x and H_y fields</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>wavenumber</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#complex">complex</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Wavenumber assuming fields have z-dependence of <code>exp(-i * wavenumber * z)</code>.
|
|
It should satisfy <code>operator_h() @ h_xy == wavenumber**2 * h_xy</code></p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>omega</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#complex">complex</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>The angular frequency of the system</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>dxes</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" dx_lists2_t
|
|
|
|
|
|
|
|
module-attribute
|
|
(meanas.fdmath.dx_lists2_t)" href="#api-fdmath-meanas.fdmath.types.dx_lists2_t">dx_lists2_t</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Grid parameters <code>[dx_e, dx_h]</code> as described in <code>meanas.fdmath.types</code> (2D)</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>epsilon</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" vfdslice (meanas.fdmath.vfdslice)" href="#api-fdmath-meanas.fdmath.types.vfdslice">vfdslice</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Vectorized dielectric constant grid</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>mu</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" vfdslice (meanas.fdmath.vfdslice)" href="#api-fdmath-meanas.fdmath.types.vfdslice">vfdslice</a> | None</code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Vectorized magnetic permeability grid (default 1 everywhere)</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<code>None</code>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>prop_phase</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#float">float</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Phase shift <code>(dz * corrected_wavenumber)</code> over 1 cell in propagation direction.
|
|
Default 0 (continuous propagation direction, i.e. dz->0).</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<code>0</code>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
<p><span class="doc-section-title">Returns:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title="meanas.fdmath.vcfdslice_t" href="#meanas.fdmath.vcfdslice_t">vcfdslice_t</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p><code>(e, h)</code>, where each field is vectorized, normalized,</p>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title="meanas.fdmath.vcfdslice_t" href="#meanas.fdmath.vcfdslice_t">vcfdslice_t</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>and contains all three vector components.</p>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
<details class="notes" open>
|
|
<summary>Notes</summary>
|
|
<p>This is the <code>H_x/H_y</code> analogue of <code>normalized_fields_e(...)</code>. The final
|
|
normalized mode should describe the same physical solution, but because
|
|
the overall complex phase and sign are chosen heuristically,
|
|
<code>normalized_fields_e(...)</code> and <code>normalized_fields_h(...)</code> need not return
|
|
identical representatives for nearly symmetric modes.</p>
|
|
</details>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="doc doc-object doc-function">
|
|
|
|
|
|
<h3 id="api-waveguides-meanas.fdfd.waveguide_2d.exy2h" class="doc doc-heading">
|
|
<code class="doc-symbol doc-symbol-heading doc-symbol-function"></code> <span class="doc doc-object-name doc-function-name">exy2h</span>
|
|
|
|
|
|
<a href="#api-waveguides-meanas.fdfd.waveguide_2d.exy2h" class="headerlink" title="Permanent link">¶</a></h3>
|
|
<div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#api-waveguides-__codelineno-0-1"></a><span class="nf">exy2h</span><span class="p">(</span>
|
|
<a id="__codelineno-0-2" name="__codelineno-0-2" href="#api-waveguides-__codelineno-0-2"></a> <span class="n">wavenumber</span><span class="p">:</span> <span class="nb">complex</span><span class="p">,</span>
|
|
<a id="__codelineno-0-3" name="__codelineno-0-3" href="#api-waveguides-__codelineno-0-3"></a> <span class="n">omega</span><span class="p">:</span> <span class="nb">complex</span><span class="p">,</span>
|
|
<a id="__codelineno-0-4" name="__codelineno-0-4" href="#api-waveguides-__codelineno-0-4"></a> <span class="n">dxes</span><span class="p">:</span> <span class="n">dx_lists2_t</span><span class="p">,</span>
|
|
<a id="__codelineno-0-5" name="__codelineno-0-5" href="#api-waveguides-__codelineno-0-5"></a> <span class="n">epsilon</span><span class="p">:</span> <span class="n">vfdslice</span><span class="p">,</span>
|
|
<a id="__codelineno-0-6" name="__codelineno-0-6" href="#api-waveguides-__codelineno-0-6"></a> <span class="n">mu</span><span class="p">:</span> <span class="n">vfdslice</span> <span class="o">|</span> <span class="kc">None</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
|
|
<a id="__codelineno-0-7" name="__codelineno-0-7" href="#api-waveguides-__codelineno-0-7"></a><span class="p">)</span> <span class="o">-></span> <span class="n">sparse</span><span class="o">.</span><span class="n">sparray</span>
|
|
</code></pre></div>
|
|
|
|
<div class="doc doc-contents ">
|
|
|
|
<p>Operator which transforms the vector <code>e_xy</code> containing the vectorized E_x and E_y fields,
|
|
into a vectorized H containing all three H components</p>
|
|
|
|
|
|
<p><span class="doc-section-title">Parameters:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
<th>Default</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>wavenumber</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#complex">complex</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Wavenumber assuming fields have z-dependence of <code>exp(-i * wavenumber * z)</code>.
|
|
It should satisfy <code>operator_e() @ e_xy == wavenumber**2 * e_xy</code></p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>omega</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#complex">complex</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>The angular frequency of the system</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>dxes</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" dx_lists2_t
|
|
|
|
|
|
|
|
module-attribute
|
|
(meanas.fdmath.dx_lists2_t)" href="#api-fdmath-meanas.fdmath.types.dx_lists2_t">dx_lists2_t</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Grid parameters <code>[dx_e, dx_h]</code> as described in <code>meanas.fdmath.types</code> (2D)</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>epsilon</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" vfdslice (meanas.fdmath.vfdslice)" href="#api-fdmath-meanas.fdmath.types.vfdslice">vfdslice</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Vectorized dielectric constant grid</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>mu</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" vfdslice (meanas.fdmath.vfdslice)" href="#api-fdmath-meanas.fdmath.types.vfdslice">vfdslice</a> | None</code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Vectorized magnetic permeability grid (default 1 everywhere)</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<code>None</code>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
<p><span class="doc-section-title">Returns:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title="scipy.sparse.sparray" href="#scipy.sparse.sparray">sparray</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Sparse matrix representing the operator.</p>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="doc doc-object doc-function">
|
|
|
|
|
|
<h3 id="api-waveguides-meanas.fdfd.waveguide_2d.hxy2e" class="doc doc-heading">
|
|
<code class="doc-symbol doc-symbol-heading doc-symbol-function"></code> <span class="doc doc-object-name doc-function-name">hxy2e</span>
|
|
|
|
|
|
<a href="#api-waveguides-meanas.fdfd.waveguide_2d.hxy2e" class="headerlink" title="Permanent link">¶</a></h3>
|
|
<div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#api-waveguides-__codelineno-0-1"></a><span class="nf">hxy2e</span><span class="p">(</span>
|
|
<a id="__codelineno-0-2" name="__codelineno-0-2" href="#api-waveguides-__codelineno-0-2"></a> <span class="n">wavenumber</span><span class="p">:</span> <span class="nb">complex</span><span class="p">,</span>
|
|
<a id="__codelineno-0-3" name="__codelineno-0-3" href="#api-waveguides-__codelineno-0-3"></a> <span class="n">omega</span><span class="p">:</span> <span class="nb">complex</span><span class="p">,</span>
|
|
<a id="__codelineno-0-4" name="__codelineno-0-4" href="#api-waveguides-__codelineno-0-4"></a> <span class="n">dxes</span><span class="p">:</span> <span class="n">dx_lists2_t</span><span class="p">,</span>
|
|
<a id="__codelineno-0-5" name="__codelineno-0-5" href="#api-waveguides-__codelineno-0-5"></a> <span class="n">epsilon</span><span class="p">:</span> <span class="n">vfdslice</span><span class="p">,</span>
|
|
<a id="__codelineno-0-6" name="__codelineno-0-6" href="#api-waveguides-__codelineno-0-6"></a> <span class="n">mu</span><span class="p">:</span> <span class="n">vfdslice</span> <span class="o">|</span> <span class="kc">None</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
|
|
<a id="__codelineno-0-7" name="__codelineno-0-7" href="#api-waveguides-__codelineno-0-7"></a><span class="p">)</span> <span class="o">-></span> <span class="n">sparse</span><span class="o">.</span><span class="n">sparray</span>
|
|
</code></pre></div>
|
|
|
|
<div class="doc doc-contents ">
|
|
|
|
<p>Operator which transforms the vector <code>h_xy</code> containing the vectorized H_x and H_y fields,
|
|
into a vectorized E containing all three E components</p>
|
|
|
|
|
|
<p><span class="doc-section-title">Parameters:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
<th>Default</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>wavenumber</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#complex">complex</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Wavenumber assuming fields have z-dependence of <code>exp(-i * wavenumber * z)</code>.
|
|
It should satisfy <code>operator_h() @ h_xy == wavenumber**2 * h_xy</code></p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>omega</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#complex">complex</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>The angular frequency of the system</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>dxes</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" dx_lists2_t
|
|
|
|
|
|
|
|
module-attribute
|
|
(meanas.fdmath.dx_lists2_t)" href="#api-fdmath-meanas.fdmath.types.dx_lists2_t">dx_lists2_t</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Grid parameters <code>[dx_e, dx_h]</code> as described in <code>meanas.fdmath.types</code> (2D)</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>epsilon</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" vfdslice (meanas.fdmath.vfdslice)" href="#api-fdmath-meanas.fdmath.types.vfdslice">vfdslice</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Vectorized dielectric constant grid</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>mu</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" vfdslice (meanas.fdmath.vfdslice)" href="#api-fdmath-meanas.fdmath.types.vfdslice">vfdslice</a> | None</code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Vectorized magnetic permeability grid (default 1 everywhere)</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<code>None</code>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
<p><span class="doc-section-title">Returns:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title="scipy.sparse.sparray" href="#scipy.sparse.sparray">sparray</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Sparse matrix representing the operator.</p>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="doc doc-object doc-function">
|
|
|
|
|
|
<h3 id="api-waveguides-meanas.fdfd.waveguide_2d.hxy2h" class="doc doc-heading">
|
|
<code class="doc-symbol doc-symbol-heading doc-symbol-function"></code> <span class="doc doc-object-name doc-function-name">hxy2h</span>
|
|
|
|
|
|
<a href="#api-waveguides-meanas.fdfd.waveguide_2d.hxy2h" class="headerlink" title="Permanent link">¶</a></h3>
|
|
<div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#api-waveguides-__codelineno-0-1"></a><span class="nf">hxy2h</span><span class="p">(</span>
|
|
<a id="__codelineno-0-2" name="__codelineno-0-2" href="#api-waveguides-__codelineno-0-2"></a> <span class="n">wavenumber</span><span class="p">:</span> <span class="nb">complex</span><span class="p">,</span>
|
|
<a id="__codelineno-0-3" name="__codelineno-0-3" href="#api-waveguides-__codelineno-0-3"></a> <span class="n">dxes</span><span class="p">:</span> <span class="n">dx_lists2_t</span><span class="p">,</span>
|
|
<a id="__codelineno-0-4" name="__codelineno-0-4" href="#api-waveguides-__codelineno-0-4"></a> <span class="n">mu</span><span class="p">:</span> <span class="n">vfdslice</span> <span class="o">|</span> <span class="kc">None</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
|
|
<a id="__codelineno-0-5" name="__codelineno-0-5" href="#api-waveguides-__codelineno-0-5"></a><span class="p">)</span> <span class="o">-></span> <span class="n">sparse</span><span class="o">.</span><span class="n">sparray</span>
|
|
</code></pre></div>
|
|
|
|
<div class="doc doc-contents ">
|
|
|
|
<p>Operator which transforms the vector <code>h_xy</code> containing the vectorized H_x and H_y fields,
|
|
into a vectorized H containing all three H components</p>
|
|
|
|
|
|
<p><span class="doc-section-title">Parameters:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
<th>Default</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>wavenumber</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#complex">complex</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Wavenumber assuming fields have z-dependence of <code>exp(-i * wavenumber * z)</code>.
|
|
It should satisfy <code>operator_h() @ h_xy == wavenumber**2 * h_xy</code></p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>dxes</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" dx_lists2_t
|
|
|
|
|
|
|
|
module-attribute
|
|
(meanas.fdmath.dx_lists2_t)" href="#api-fdmath-meanas.fdmath.types.dx_lists2_t">dx_lists2_t</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Grid parameters <code>[dx_e, dx_h]</code> as described in <code>meanas.fdmath.types</code> (2D)</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>mu</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" vfdslice (meanas.fdmath.vfdslice)" href="#api-fdmath-meanas.fdmath.types.vfdslice">vfdslice</a> | None</code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Vectorized magnetic permeability grid (default 1 everywhere)</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<code>None</code>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
<p><span class="doc-section-title">Returns:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title="scipy.sparse.sparray" href="#scipy.sparse.sparray">sparray</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Sparse matrix representing the operator.</p>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="doc doc-object doc-function">
|
|
|
|
|
|
<h3 id="api-waveguides-meanas.fdfd.waveguide_2d.exy2e" class="doc doc-heading">
|
|
<code class="doc-symbol doc-symbol-heading doc-symbol-function"></code> <span class="doc doc-object-name doc-function-name">exy2e</span>
|
|
|
|
|
|
<a href="#api-waveguides-meanas.fdfd.waveguide_2d.exy2e" class="headerlink" title="Permanent link">¶</a></h3>
|
|
<div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#api-waveguides-__codelineno-0-1"></a><span class="nf">exy2e</span><span class="p">(</span>
|
|
<a id="__codelineno-0-2" name="__codelineno-0-2" href="#api-waveguides-__codelineno-0-2"></a> <span class="n">wavenumber</span><span class="p">:</span> <span class="nb">complex</span><span class="p">,</span>
|
|
<a id="__codelineno-0-3" name="__codelineno-0-3" href="#api-waveguides-__codelineno-0-3"></a> <span class="n">dxes</span><span class="p">:</span> <span class="n">dx_lists2_t</span><span class="p">,</span>
|
|
<a id="__codelineno-0-4" name="__codelineno-0-4" href="#api-waveguides-__codelineno-0-4"></a> <span class="n">epsilon</span><span class="p">:</span> <span class="n">vfdslice</span><span class="p">,</span>
|
|
<a id="__codelineno-0-5" name="__codelineno-0-5" href="#api-waveguides-__codelineno-0-5"></a><span class="p">)</span> <span class="o">-></span> <span class="n">sparse</span><span class="o">.</span><span class="n">sparray</span>
|
|
</code></pre></div>
|
|
|
|
<div class="doc doc-contents ">
|
|
|
|
<p>Operator which transforms the vector <code>e_xy</code> containing the vectorized E_x and E_y fields,
|
|
into a vectorized E containing all three E components</p>
|
|
<p>From the operator derivation (see module docs), we have</p>
|
|
<div class="arithmatex">\[
|
|
\imath \omega \epsilon_{zz} E_z = \hat{\partial}_x H_y - \hat{\partial}_y H_x \\
|
|
\]</div>
|
|
<p>as well as the intermediate equations</p>
|
|
<div class="arithmatex">\[
|
|
\begin{aligned}
|
|
\imath \beta H_y &= \imath \omega \epsilon_{xx} E_x - \hat{\partial}_y H_z \\
|
|
\imath \beta H_x &= -\imath \omega \epsilon_{yy} E_y - \hat{\partial}_x H_z \\
|
|
\end{aligned}
|
|
\]</div>
|
|
<p>Combining these, we get</p>
|
|
<div class="arithmatex">\[
|
|
\begin{aligned}
|
|
E_z &= \frac{1}{- \omega \beta \epsilon_{zz}} ((
|
|
\hat{\partial}_y \hat{\partial}_x H_z
|
|
-\hat{\partial}_x \hat{\partial}_y H_z)
|
|
+ \imath \omega (\hat{\partial}_x \epsilon_{xx} E_x + \hat{\partial}_y \epsilon{yy} E_y))
|
|
&= \frac{1}{\imath \beta \epsilon_{zz}} (\hat{\partial}_x \epsilon_{xx} E_x + \hat{\partial}_y \epsilon{yy} E_y)
|
|
\end{aligned}
|
|
\]</div>
|
|
|
|
|
|
<p><span class="doc-section-title">Parameters:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
<th>Default</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>wavenumber</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#complex">complex</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Wavenumber assuming fields have z-dependence of <code>exp(-i * wavenumber * z)</code>
|
|
It should satisfy <code>operator_e() @ e_xy == wavenumber**2 * e_xy</code></p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>dxes</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" dx_lists2_t
|
|
|
|
|
|
|
|
module-attribute
|
|
(meanas.fdmath.dx_lists2_t)" href="#api-fdmath-meanas.fdmath.types.dx_lists2_t">dx_lists2_t</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Grid parameters <code>[dx_e, dx_h]</code> as described in <code>meanas.fdmath.types</code> (2D)</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>epsilon</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" vfdslice (meanas.fdmath.vfdslice)" href="#api-fdmath-meanas.fdmath.types.vfdslice">vfdslice</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Vectorized dielectric constant grid</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
<p><span class="doc-section-title">Returns:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title="scipy.sparse.sparray" href="#scipy.sparse.sparray">sparray</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Sparse matrix representing the operator.</p>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="doc doc-object doc-function">
|
|
|
|
|
|
<h3 id="api-waveguides-meanas.fdfd.waveguide_2d.e2h" class="doc doc-heading">
|
|
<code class="doc-symbol doc-symbol-heading doc-symbol-function"></code> <span class="doc doc-object-name doc-function-name">e2h</span>
|
|
|
|
|
|
<a href="#api-waveguides-meanas.fdfd.waveguide_2d.e2h" class="headerlink" title="Permanent link">¶</a></h3>
|
|
<div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#api-waveguides-__codelineno-0-1"></a><span class="nf">e2h</span><span class="p">(</span>
|
|
<a id="__codelineno-0-2" name="__codelineno-0-2" href="#api-waveguides-__codelineno-0-2"></a> <span class="n">wavenumber</span><span class="p">:</span> <span class="nb">complex</span><span class="p">,</span>
|
|
<a id="__codelineno-0-3" name="__codelineno-0-3" href="#api-waveguides-__codelineno-0-3"></a> <span class="n">omega</span><span class="p">:</span> <span class="nb">complex</span><span class="p">,</span>
|
|
<a id="__codelineno-0-4" name="__codelineno-0-4" href="#api-waveguides-__codelineno-0-4"></a> <span class="n">dxes</span><span class="p">:</span> <span class="n">dx_lists2_t</span><span class="p">,</span>
|
|
<a id="__codelineno-0-5" name="__codelineno-0-5" href="#api-waveguides-__codelineno-0-5"></a> <span class="n">mu</span><span class="p">:</span> <span class="n">vfdslice</span> <span class="o">|</span> <span class="kc">None</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
|
|
<a id="__codelineno-0-6" name="__codelineno-0-6" href="#api-waveguides-__codelineno-0-6"></a><span class="p">)</span> <span class="o">-></span> <span class="n">sparse</span><span class="o">.</span><span class="n">sparray</span>
|
|
</code></pre></div>
|
|
|
|
<div class="doc doc-contents ">
|
|
|
|
<p>Returns an operator which, when applied to a vectorized E eigenfield, produces
|
|
the vectorized H eigenfield slice.</p>
|
|
|
|
|
|
<p><span class="doc-section-title">Parameters:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
<th>Default</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>wavenumber</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#complex">complex</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Wavenumber assuming fields have z-dependence of <code>exp(-i * wavenumber * z)</code></p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>omega</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#complex">complex</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>The angular frequency of the system</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>dxes</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" dx_lists2_t
|
|
|
|
|
|
|
|
module-attribute
|
|
(meanas.fdmath.dx_lists2_t)" href="#api-fdmath-meanas.fdmath.types.dx_lists2_t">dx_lists2_t</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Grid parameters <code>[dx_e, dx_h]</code> as described in <code>meanas.fdmath.types</code> (2D)</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>mu</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" vfdslice (meanas.fdmath.vfdslice)" href="#api-fdmath-meanas.fdmath.types.vfdslice">vfdslice</a> | None</code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Vectorized magnetic permeability grid (default 1 everywhere)</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<code>None</code>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
<p><span class="doc-section-title">Returns:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title="scipy.sparse.sparray" href="#scipy.sparse.sparray">sparray</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Sparse matrix representation of the operator.</p>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="doc doc-object doc-function">
|
|
|
|
|
|
<h3 id="api-waveguides-meanas.fdfd.waveguide_2d.h2e" class="doc doc-heading">
|
|
<code class="doc-symbol doc-symbol-heading doc-symbol-function"></code> <span class="doc doc-object-name doc-function-name">h2e</span>
|
|
|
|
|
|
<a href="#api-waveguides-meanas.fdfd.waveguide_2d.h2e" class="headerlink" title="Permanent link">¶</a></h3>
|
|
<div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#api-waveguides-__codelineno-0-1"></a><span class="nf">h2e</span><span class="p">(</span>
|
|
<a id="__codelineno-0-2" name="__codelineno-0-2" href="#api-waveguides-__codelineno-0-2"></a> <span class="n">wavenumber</span><span class="p">:</span> <span class="nb">complex</span><span class="p">,</span>
|
|
<a id="__codelineno-0-3" name="__codelineno-0-3" href="#api-waveguides-__codelineno-0-3"></a> <span class="n">omega</span><span class="p">:</span> <span class="nb">complex</span><span class="p">,</span>
|
|
<a id="__codelineno-0-4" name="__codelineno-0-4" href="#api-waveguides-__codelineno-0-4"></a> <span class="n">dxes</span><span class="p">:</span> <span class="n">dx_lists2_t</span><span class="p">,</span>
|
|
<a id="__codelineno-0-5" name="__codelineno-0-5" href="#api-waveguides-__codelineno-0-5"></a> <span class="n">epsilon</span><span class="p">:</span> <span class="n">vfdslice</span><span class="p">,</span>
|
|
<a id="__codelineno-0-6" name="__codelineno-0-6" href="#api-waveguides-__codelineno-0-6"></a><span class="p">)</span> <span class="o">-></span> <span class="n">sparse</span><span class="o">.</span><span class="n">sparray</span>
|
|
</code></pre></div>
|
|
|
|
<div class="doc doc-contents ">
|
|
|
|
<p>Returns an operator which, when applied to a vectorized H eigenfield, produces
|
|
the vectorized E eigenfield slice.</p>
|
|
|
|
|
|
<p><span class="doc-section-title">Parameters:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
<th>Default</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>wavenumber</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#complex">complex</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Wavenumber assuming fields have z-dependence of <code>exp(-i * wavenumber * z)</code></p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>omega</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#complex">complex</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>The angular frequency of the system</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>dxes</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" dx_lists2_t
|
|
|
|
|
|
|
|
module-attribute
|
|
(meanas.fdmath.dx_lists2_t)" href="#api-fdmath-meanas.fdmath.types.dx_lists2_t">dx_lists2_t</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Grid parameters <code>[dx_e, dx_h]</code> as described in <code>meanas.fdmath.types</code> (2D)</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>epsilon</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" vfdslice (meanas.fdmath.vfdslice)" href="#api-fdmath-meanas.fdmath.types.vfdslice">vfdslice</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Vectorized dielectric constant grid</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
<p><span class="doc-section-title">Returns:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title="scipy.sparse.sparray" href="#scipy.sparse.sparray">sparray</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Sparse matrix representation of the operator.</p>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="doc doc-object doc-function">
|
|
|
|
|
|
<h3 id="api-waveguides-meanas.fdfd.waveguide_2d.curl_e" class="doc doc-heading">
|
|
<code class="doc-symbol doc-symbol-heading doc-symbol-function"></code> <span class="doc doc-object-name doc-function-name">curl_e</span>
|
|
|
|
|
|
<a href="#api-waveguides-meanas.fdfd.waveguide_2d.curl_e" class="headerlink" title="Permanent link">¶</a></h3>
|
|
<div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#api-waveguides-__codelineno-0-1"></a><span class="nf">curl_e</span><span class="p">(</span>
|
|
<a id="__codelineno-0-2" name="__codelineno-0-2" href="#api-waveguides-__codelineno-0-2"></a> <span class="n">wavenumber</span><span class="p">:</span> <span class="nb">complex</span><span class="p">,</span> <span class="n">dxes</span><span class="p">:</span> <span class="n">dx_lists2_t</span>
|
|
<a id="__codelineno-0-3" name="__codelineno-0-3" href="#api-waveguides-__codelineno-0-3"></a><span class="p">)</span> <span class="o">-></span> <span class="n">sparse</span><span class="o">.</span><span class="n">sparray</span>
|
|
</code></pre></div>
|
|
|
|
<div class="doc doc-contents ">
|
|
|
|
<p>Discretized curl operator for use with the waveguide E field slice.</p>
|
|
|
|
|
|
<p><span class="doc-section-title">Parameters:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
<th>Default</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>wavenumber</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#complex">complex</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Wavenumber assuming fields have z-dependence of <code>exp(-i * wavenumber * z)</code></p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>dxes</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" dx_lists2_t
|
|
|
|
|
|
|
|
module-attribute
|
|
(meanas.fdmath.dx_lists2_t)" href="#api-fdmath-meanas.fdmath.types.dx_lists2_t">dx_lists2_t</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Grid parameters <code>[dx_e, dx_h]</code> as described in <code>meanas.fdmath.types</code> (2D)</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
<p><span class="doc-section-title">Returns:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title="scipy.sparse.sparray" href="#scipy.sparse.sparray">sparray</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Sparse matrix representation of the operator.</p>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="doc doc-object doc-function">
|
|
|
|
|
|
<h3 id="api-waveguides-meanas.fdfd.waveguide_2d.curl_h" class="doc doc-heading">
|
|
<code class="doc-symbol doc-symbol-heading doc-symbol-function"></code> <span class="doc doc-object-name doc-function-name">curl_h</span>
|
|
|
|
|
|
<a href="#api-waveguides-meanas.fdfd.waveguide_2d.curl_h" class="headerlink" title="Permanent link">¶</a></h3>
|
|
<div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#api-waveguides-__codelineno-0-1"></a><span class="nf">curl_h</span><span class="p">(</span>
|
|
<a id="__codelineno-0-2" name="__codelineno-0-2" href="#api-waveguides-__codelineno-0-2"></a> <span class="n">wavenumber</span><span class="p">:</span> <span class="nb">complex</span><span class="p">,</span> <span class="n">dxes</span><span class="p">:</span> <span class="n">dx_lists2_t</span>
|
|
<a id="__codelineno-0-3" name="__codelineno-0-3" href="#api-waveguides-__codelineno-0-3"></a><span class="p">)</span> <span class="o">-></span> <span class="n">sparse</span><span class="o">.</span><span class="n">sparray</span>
|
|
</code></pre></div>
|
|
|
|
<div class="doc doc-contents ">
|
|
|
|
<p>Discretized curl operator for use with the waveguide H field slice.</p>
|
|
|
|
|
|
<p><span class="doc-section-title">Parameters:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
<th>Default</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>wavenumber</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#complex">complex</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Wavenumber assuming fields have z-dependence of <code>exp(-i * wavenumber * z)</code></p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>dxes</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" dx_lists2_t
|
|
|
|
|
|
|
|
module-attribute
|
|
(meanas.fdmath.dx_lists2_t)" href="#api-fdmath-meanas.fdmath.types.dx_lists2_t">dx_lists2_t</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Grid parameters <code>[dx_e, dx_h]</code> as described in <code>meanas.fdmath.types</code> (2D)</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
<p><span class="doc-section-title">Returns:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title="scipy.sparse.sparray" href="#scipy.sparse.sparray">sparray</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Sparse matrix representation of the operator.</p>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="doc doc-object doc-function">
|
|
|
|
|
|
<h3 id="api-waveguides-meanas.fdfd.waveguide_2d.h_err" class="doc doc-heading">
|
|
<code class="doc-symbol doc-symbol-heading doc-symbol-function"></code> <span class="doc doc-object-name doc-function-name">h_err</span>
|
|
|
|
|
|
<a href="#api-waveguides-meanas.fdfd.waveguide_2d.h_err" class="headerlink" title="Permanent link">¶</a></h3>
|
|
<div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#api-waveguides-__codelineno-0-1"></a><span class="nf">h_err</span><span class="p">(</span>
|
|
<a id="__codelineno-0-2" name="__codelineno-0-2" href="#api-waveguides-__codelineno-0-2"></a> <span class="n">h</span><span class="p">:</span> <span class="n">vcfdslice</span><span class="p">,</span>
|
|
<a id="__codelineno-0-3" name="__codelineno-0-3" href="#api-waveguides-__codelineno-0-3"></a> <span class="n">wavenumber</span><span class="p">:</span> <span class="nb">complex</span><span class="p">,</span>
|
|
<a id="__codelineno-0-4" name="__codelineno-0-4" href="#api-waveguides-__codelineno-0-4"></a> <span class="n">omega</span><span class="p">:</span> <span class="nb">complex</span><span class="p">,</span>
|
|
<a id="__codelineno-0-5" name="__codelineno-0-5" href="#api-waveguides-__codelineno-0-5"></a> <span class="n">dxes</span><span class="p">:</span> <span class="n">dx_lists2_t</span><span class="p">,</span>
|
|
<a id="__codelineno-0-6" name="__codelineno-0-6" href="#api-waveguides-__codelineno-0-6"></a> <span class="n">epsilon</span><span class="p">:</span> <span class="n">vfdslice</span><span class="p">,</span>
|
|
<a id="__codelineno-0-7" name="__codelineno-0-7" href="#api-waveguides-__codelineno-0-7"></a> <span class="n">mu</span><span class="p">:</span> <span class="n">vfdslice</span> <span class="o">|</span> <span class="kc">None</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
|
|
<a id="__codelineno-0-8" name="__codelineno-0-8" href="#api-waveguides-__codelineno-0-8"></a><span class="p">)</span> <span class="o">-></span> <span class="nb">float</span>
|
|
</code></pre></div>
|
|
|
|
<div class="doc doc-contents ">
|
|
|
|
<p>Calculates the relative error in the H field</p>
|
|
|
|
|
|
<p><span class="doc-section-title">Parameters:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
<th>Default</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>h</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" vcfdslice (meanas.fdmath.vcfdslice)" href="#api-fdmath-meanas.fdmath.types.vcfdslice">vcfdslice</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Vectorized H field</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>wavenumber</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#complex">complex</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Wavenumber assuming fields have z-dependence of <code>exp(-i * wavenumber * z)</code></p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>omega</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#complex">complex</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>The angular frequency of the system</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>dxes</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" dx_lists2_t
|
|
|
|
|
|
|
|
module-attribute
|
|
(meanas.fdmath.dx_lists2_t)" href="#api-fdmath-meanas.fdmath.types.dx_lists2_t">dx_lists2_t</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Grid parameters <code>[dx_e, dx_h]</code> as described in <code>meanas.fdmath.types</code> (2D)</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>epsilon</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" vfdslice (meanas.fdmath.vfdslice)" href="#api-fdmath-meanas.fdmath.types.vfdslice">vfdslice</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Vectorized dielectric constant grid</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>mu</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" vfdslice (meanas.fdmath.vfdslice)" href="#api-fdmath-meanas.fdmath.types.vfdslice">vfdslice</a> | None</code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Vectorized magnetic permeability grid (default 1 everywhere)</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<code>None</code>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
<p><span class="doc-section-title">Returns:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#float">float</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Relative error <code>norm(A_h @ h) / norm(h)</code>.</p>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="doc doc-object doc-function">
|
|
|
|
|
|
<h3 id="api-waveguides-meanas.fdfd.waveguide_2d.e_err" class="doc doc-heading">
|
|
<code class="doc-symbol doc-symbol-heading doc-symbol-function"></code> <span class="doc doc-object-name doc-function-name">e_err</span>
|
|
|
|
|
|
<a href="#api-waveguides-meanas.fdfd.waveguide_2d.e_err" class="headerlink" title="Permanent link">¶</a></h3>
|
|
<div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#api-waveguides-__codelineno-0-1"></a><span class="nf">e_err</span><span class="p">(</span>
|
|
<a id="__codelineno-0-2" name="__codelineno-0-2" href="#api-waveguides-__codelineno-0-2"></a> <span class="n">e</span><span class="p">:</span> <span class="n">vcfdslice</span><span class="p">,</span>
|
|
<a id="__codelineno-0-3" name="__codelineno-0-3" href="#api-waveguides-__codelineno-0-3"></a> <span class="n">wavenumber</span><span class="p">:</span> <span class="nb">complex</span><span class="p">,</span>
|
|
<a id="__codelineno-0-4" name="__codelineno-0-4" href="#api-waveguides-__codelineno-0-4"></a> <span class="n">omega</span><span class="p">:</span> <span class="nb">complex</span><span class="p">,</span>
|
|
<a id="__codelineno-0-5" name="__codelineno-0-5" href="#api-waveguides-__codelineno-0-5"></a> <span class="n">dxes</span><span class="p">:</span> <span class="n">dx_lists2_t</span><span class="p">,</span>
|
|
<a id="__codelineno-0-6" name="__codelineno-0-6" href="#api-waveguides-__codelineno-0-6"></a> <span class="n">epsilon</span><span class="p">:</span> <span class="n">vfdslice</span><span class="p">,</span>
|
|
<a id="__codelineno-0-7" name="__codelineno-0-7" href="#api-waveguides-__codelineno-0-7"></a> <span class="n">mu</span><span class="p">:</span> <span class="n">vfdslice</span> <span class="o">|</span> <span class="kc">None</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
|
|
<a id="__codelineno-0-8" name="__codelineno-0-8" href="#api-waveguides-__codelineno-0-8"></a><span class="p">)</span> <span class="o">-></span> <span class="nb">float</span>
|
|
</code></pre></div>
|
|
|
|
<div class="doc doc-contents ">
|
|
|
|
<p>Calculates the relative error in the E field</p>
|
|
|
|
|
|
<p><span class="doc-section-title">Parameters:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
<th>Default</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>e</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" vcfdslice (meanas.fdmath.vcfdslice)" href="#api-fdmath-meanas.fdmath.types.vcfdslice">vcfdslice</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Vectorized E field</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>wavenumber</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#complex">complex</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Wavenumber assuming fields have z-dependence of <code>exp(-i * wavenumber * z)</code></p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>omega</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#complex">complex</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>The angular frequency of the system</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>dxes</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" dx_lists2_t
|
|
|
|
|
|
|
|
module-attribute
|
|
(meanas.fdmath.dx_lists2_t)" href="#api-fdmath-meanas.fdmath.types.dx_lists2_t">dx_lists2_t</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Grid parameters <code>[dx_e, dx_h]</code> as described in <code>meanas.fdmath.types</code> (2D)</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>epsilon</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" vfdslice (meanas.fdmath.vfdslice)" href="#api-fdmath-meanas.fdmath.types.vfdslice">vfdslice</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Vectorized dielectric constant grid</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>mu</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" vfdslice (meanas.fdmath.vfdslice)" href="#api-fdmath-meanas.fdmath.types.vfdslice">vfdslice</a> | None</code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Vectorized magnetic permeability grid (default 1 everywhere)</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<code>None</code>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
<p><span class="doc-section-title">Returns:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#float">float</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Relative error <code>norm(A_e @ e) / norm(e)</code>.</p>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="doc doc-object doc-function">
|
|
|
|
|
|
<h3 id="api-waveguides-meanas.fdfd.waveguide_2d.sensitivity" class="doc doc-heading">
|
|
<code class="doc-symbol doc-symbol-heading doc-symbol-function"></code> <span class="doc doc-object-name doc-function-name">sensitivity</span>
|
|
|
|
|
|
<a href="#api-waveguides-meanas.fdfd.waveguide_2d.sensitivity" class="headerlink" title="Permanent link">¶</a></h3>
|
|
<div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#api-waveguides-__codelineno-0-1"></a><span class="nf">sensitivity</span><span class="p">(</span>
|
|
<a id="__codelineno-0-2" name="__codelineno-0-2" href="#api-waveguides-__codelineno-0-2"></a> <span class="n">e_norm</span><span class="p">:</span> <span class="n">vcfdslice</span><span class="p">,</span>
|
|
<a id="__codelineno-0-3" name="__codelineno-0-3" href="#api-waveguides-__codelineno-0-3"></a> <span class="n">h_norm</span><span class="p">:</span> <span class="n">vcfdslice</span><span class="p">,</span>
|
|
<a id="__codelineno-0-4" name="__codelineno-0-4" href="#api-waveguides-__codelineno-0-4"></a> <span class="n">wavenumber</span><span class="p">:</span> <span class="nb">complex</span><span class="p">,</span>
|
|
<a id="__codelineno-0-5" name="__codelineno-0-5" href="#api-waveguides-__codelineno-0-5"></a> <span class="n">omega</span><span class="p">:</span> <span class="nb">complex</span><span class="p">,</span>
|
|
<a id="__codelineno-0-6" name="__codelineno-0-6" href="#api-waveguides-__codelineno-0-6"></a> <span class="n">dxes</span><span class="p">:</span> <span class="n">dx_lists2_t</span><span class="p">,</span>
|
|
<a id="__codelineno-0-7" name="__codelineno-0-7" href="#api-waveguides-__codelineno-0-7"></a> <span class="n">epsilon</span><span class="p">:</span> <span class="n">vfdslice</span><span class="p">,</span>
|
|
<a id="__codelineno-0-8" name="__codelineno-0-8" href="#api-waveguides-__codelineno-0-8"></a> <span class="n">mu</span><span class="p">:</span> <span class="n">vfdslice</span> <span class="o">|</span> <span class="kc">None</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
|
|
<a id="__codelineno-0-9" name="__codelineno-0-9" href="#api-waveguides-__codelineno-0-9"></a><span class="p">)</span> <span class="o">-></span> <span class="n">vcfdslice_t</span>
|
|
</code></pre></div>
|
|
|
|
<div class="doc doc-contents ">
|
|
|
|
<p>Given a waveguide structure (<code>dxes</code>, <code>epsilon</code>, <code>mu</code>) and mode fields
|
|
(<code>e_norm</code>, <code>h_norm</code>, <code>wavenumber</code>, <code>omega</code>), calculates the sensitivity of the wavenumber
|
|
<span class="arithmatex">\(\beta\)</span> to changes in the dielectric structure <span class="arithmatex">\(\epsilon\)</span>.</p>
|
|
<p>The output is a vector of the same size as <code>vec(epsilon)</code>, with each element specifying the
|
|
sensitivity of <code>wavenumber</code> to changes in the corresponding element in <code>vec(epsilon)</code>, i.e.</p>
|
|
<div class="arithmatex">\[sens_{i} = \frac{\partial\beta}{\partial\epsilon_i}\]</div>
|
|
<p>An adjoint approach is used to calculate the sensitivity; the derivation is provided here:</p>
|
|
<p>Starting with the eigenvalue equation</p>
|
|
<div class="arithmatex">\[\beta^2 E_{xy} = A_E E_{xy}\]</div>
|
|
<p>where <span class="arithmatex">\(A_E\)</span> is the waveguide operator from <code>operator_e()</code>, and <span class="arithmatex">\(E_{xy} = \begin{bmatrix} E_x \\
|
|
E_y \end{bmatrix}\)</span>,
|
|
we can differentiate with respect to one of the <span class="arithmatex">\(\epsilon\)</span> elements (i.e. at one Yee grid point), <span class="arithmatex">\(\epsilon_i\)</span>:</p>
|
|
<div class="arithmatex">\[
|
|
(2 \beta) \partial_{\epsilon_i}(\beta) E_{xy} + \beta^2 \partial_{\epsilon_i} E_{xy}
|
|
= \partial_{\epsilon_i}(A_E) E_{xy} + A_E \partial_{\epsilon_i} E_{xy}
|
|
\]</div>
|
|
<p>We then multiply by <span class="arithmatex">\(H_{yx}^\star = \begin{bmatrix}H_y^\star \\ -H_x^\star \end{bmatrix}\)</span> from the left:</p>
|
|
<div class="arithmatex">\[
|
|
(2 \beta) \partial_{\epsilon_i}(\beta) H_{yx}^\star E_{xy} + \beta^2 H_{yx}^\star \partial_{\epsilon_i} E_{xy}
|
|
= H_{yx}^\star \partial_{\epsilon_i}(A_E) E_{xy} + H_{yx}^\star A_E \partial_{\epsilon_i} E_{xy}
|
|
\]</div>
|
|
<p>However, <span class="arithmatex">\(H_{yx}^\star\)</span> is actually a left-eigenvector of <span class="arithmatex">\(A_E\)</span>. This can be verified by inspecting
|
|
the form of <code>operator_h</code> (<span class="arithmatex">\(A_H\)</span>) and comparing its conjugate transpose to <code>operator_e</code> (<span class="arithmatex">\(A_E\)</span>). Also, note
|
|
<span class="arithmatex">\(H_{yx}^\star \cdot E_{xy} = H^\star \times E\)</span> recalls the mode orthogonality relation. See doi:10.5194/ars-9-85-201
|
|
for a similar approach. Therefore,</p>
|
|
<div class="arithmatex">\[
|
|
H_{yx}^\star A_E \partial_{\epsilon_i} E_{xy} = \beta^2 H_{yx}^\star \partial_{\epsilon_i} E_{xy}
|
|
\]</div>
|
|
<p>and we can simplify to</p>
|
|
<div class="arithmatex">\[
|
|
\partial_{\epsilon_i}(\beta)
|
|
= \frac{1}{2 \beta} \frac{H_{yx}^\star \partial_{\epsilon_i}(A_E) E_{xy} }{H_{yx}^\star E_{xy}}
|
|
\]</div>
|
|
<p>This expression can be quickly calculated for all <span class="arithmatex">\(i\)</span> by writing out the various terms of
|
|
<span class="arithmatex">\(\partial_{\epsilon_i} A_E\)</span> and recognizing that the vector-matrix-vector products (i.e. scalars)
|
|
<span class="arithmatex">\(sens_i = \vec{v}_{left} \partial_{\epsilon_i} (\epsilon_{xyz}) \vec{v}_{right}\)</span>, indexed by <span class="arithmatex">\(i\)</span>, can be expressed as
|
|
elementwise multiplications <span class="arithmatex">\(\vec{sens} = \vec{v}_{left} \star \vec{v}_{right}\)</span></p>
|
|
|
|
|
|
<p><span class="doc-section-title">Parameters:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
<th>Default</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>e_norm</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" vcfdslice (meanas.fdmath.vcfdslice)" href="#api-fdmath-meanas.fdmath.types.vcfdslice">vcfdslice</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Normalized, vectorized E_xyz field for the mode. E.g. as returned by <code>normalized_fields_e</code>.</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>h_norm</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" vcfdslice (meanas.fdmath.vcfdslice)" href="#api-fdmath-meanas.fdmath.types.vcfdslice">vcfdslice</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Normalized, vectorized H_xyz field for the mode. E.g. as returned by <code>normalized_fields_e</code>.</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>wavenumber</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#complex">complex</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Propagation constant for the mode. The z-axis is assumed to be continuous (i.e. without numerical dispersion).</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>omega</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#complex">complex</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>The angular frequency of the system.</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>dxes</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" dx_lists2_t
|
|
|
|
|
|
|
|
module-attribute
|
|
(meanas.fdmath.dx_lists2_t)" href="#api-fdmath-meanas.fdmath.types.dx_lists2_t">dx_lists2_t</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Grid parameters <code>[dx_e, dx_h]</code> as described in <code>meanas.fdmath.types</code> (2D)</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>epsilon</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" vfdslice (meanas.fdmath.vfdslice)" href="#api-fdmath-meanas.fdmath.types.vfdslice">vfdslice</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Vectorized dielectric constant grid</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>mu</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" vfdslice (meanas.fdmath.vfdslice)" href="#api-fdmath-meanas.fdmath.types.vfdslice">vfdslice</a> | None</code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Vectorized magnetic permeability grid (default 1 everywhere)</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<code>None</code>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
<p><span class="doc-section-title">Returns:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title="meanas.fdmath.vcfdslice_t" href="#meanas.fdmath.vcfdslice_t">vcfdslice_t</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Sparse matrix representation of the operator.</p>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="doc doc-object doc-function">
|
|
|
|
|
|
<h3 id="api-waveguides-meanas.fdfd.waveguide_2d.solve_modes" class="doc doc-heading">
|
|
<code class="doc-symbol doc-symbol-heading doc-symbol-function"></code> <span class="doc doc-object-name doc-function-name">solve_modes</span>
|
|
|
|
|
|
<a href="#api-waveguides-meanas.fdfd.waveguide_2d.solve_modes" class="headerlink" title="Permanent link">¶</a></h3>
|
|
<div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#api-waveguides-__codelineno-0-1"></a><span class="nf">solve_modes</span><span class="p">(</span>
|
|
<a id="__codelineno-0-2" name="__codelineno-0-2" href="#api-waveguides-__codelineno-0-2"></a> <span class="n">mode_numbers</span><span class="p">:</span> <span class="n">Sequence</span><span class="p">[</span><span class="nb">int</span><span class="p">],</span>
|
|
<a id="__codelineno-0-3" name="__codelineno-0-3" href="#api-waveguides-__codelineno-0-3"></a> <span class="n">omega</span><span class="p">:</span> <span class="nb">complex</span><span class="p">,</span>
|
|
<a id="__codelineno-0-4" name="__codelineno-0-4" href="#api-waveguides-__codelineno-0-4"></a> <span class="n">dxes</span><span class="p">:</span> <span class="n">dx_lists2_t</span><span class="p">,</span>
|
|
<a id="__codelineno-0-5" name="__codelineno-0-5" href="#api-waveguides-__codelineno-0-5"></a> <span class="n">epsilon</span><span class="p">:</span> <span class="n">vfdslice</span><span class="p">,</span>
|
|
<a id="__codelineno-0-6" name="__codelineno-0-6" href="#api-waveguides-__codelineno-0-6"></a> <span class="n">mu</span><span class="p">:</span> <span class="n">vfdslice</span> <span class="o">|</span> <span class="kc">None</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
|
|
<a id="__codelineno-0-7" name="__codelineno-0-7" href="#api-waveguides-__codelineno-0-7"></a> <span class="n">mode_margin</span><span class="p">:</span> <span class="nb">int</span> <span class="o">=</span> <span class="mi">2</span><span class="p">,</span>
|
|
<a id="__codelineno-0-8" name="__codelineno-0-8" href="#api-waveguides-__codelineno-0-8"></a><span class="p">)</span> <span class="o">-></span> <span class="nb">tuple</span><span class="p">[</span>
|
|
<a id="__codelineno-0-9" name="__codelineno-0-9" href="#api-waveguides-__codelineno-0-9"></a> <span class="n">NDArray</span><span class="p">[</span><span class="n">numpy</span><span class="o">.</span><span class="n">complex128</span><span class="p">],</span> <span class="n">NDArray</span><span class="p">[</span><span class="n">numpy</span><span class="o">.</span><span class="n">complex128</span><span class="p">]</span>
|
|
<a id="__codelineno-0-10" name="__codelineno-0-10" href="#api-waveguides-__codelineno-0-10"></a><span class="p">]</span>
|
|
</code></pre></div>
|
|
|
|
<div class="doc doc-contents ">
|
|
|
|
<p>Given a 2D region, attempts to solve for the eigenmode with the specified mode numbers.</p>
|
|
|
|
|
|
<p><span class="doc-section-title">Parameters:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
<th>Default</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>mode_numbers</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title="collections.abc.Sequence" href="#collections.abc.Sequence">Sequence</a>[<a class="autorefs autorefs-internal" href="#index-recommended-starting-points">int</a>]</code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>List of 0-indexed mode numbers to solve for</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>omega</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#complex">complex</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Angular frequency of the simulation</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>dxes</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" dx_lists2_t
|
|
|
|
|
|
|
|
module-attribute
|
|
(meanas.fdmath.dx_lists2_t)" href="#api-fdmath-meanas.fdmath.types.dx_lists2_t">dx_lists2_t</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Grid parameters <code>[dx_e, dx_h]</code> as described in <code>meanas.fdmath.types</code></p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>epsilon</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" vfdslice (meanas.fdmath.vfdslice)" href="#api-fdmath-meanas.fdmath.types.vfdslice">vfdslice</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Dielectric constant</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>mu</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" vfdslice (meanas.fdmath.vfdslice)" href="#api-fdmath-meanas.fdmath.types.vfdslice">vfdslice</a> | None</code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Magnetic permeability (default 1 everywhere)</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<code>None</code>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>mode_margin</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#index-recommended-starting-points">int</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>The eigensolver will actually solve for <code>(max(mode_number) + mode_margin)</code>
|
|
modes, but only return the target mode. Increasing this value can improve the solver's
|
|
ability to find the correct mode. Default 2.</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<code>2</code>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
<p><span class="doc-section-title">Returns:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th> <th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td><code>e_xys</code></td> <td>
|
|
<code><a class="autorefs autorefs-internal" title="numpy.typing.NDArray" href="#numpy.typing.NDArray">NDArray</a>[<a class="autorefs autorefs-internal" title="numpy.complex128" href="#numpy.complex128">complex128</a>]</code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>NDArray of vfdfield_t specifying fields. First dimension is mode number.</p>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td><code>wavenumbers</code></td> <td>
|
|
<code><a class="autorefs autorefs-internal" title="numpy.typing.NDArray" href="#numpy.typing.NDArray">NDArray</a>[<a class="autorefs autorefs-internal" title="numpy.complex128" href="#numpy.complex128">complex128</a>]</code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>list of wavenumbers</p>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="doc doc-object doc-function">
|
|
|
|
|
|
<h3 id="api-waveguides-meanas.fdfd.waveguide_2d.solve_mode" class="doc doc-heading">
|
|
<code class="doc-symbol doc-symbol-heading doc-symbol-function"></code> <span class="doc doc-object-name doc-function-name">solve_mode</span>
|
|
|
|
|
|
<a href="#api-waveguides-meanas.fdfd.waveguide_2d.solve_mode" class="headerlink" title="Permanent link">¶</a></h3>
|
|
<div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#api-waveguides-__codelineno-0-1"></a><span class="nf">solve_mode</span><span class="p">(</span>
|
|
<a id="__codelineno-0-2" name="__codelineno-0-2" href="#api-waveguides-__codelineno-0-2"></a> <span class="n">mode_number</span><span class="p">:</span> <span class="nb">int</span><span class="p">,</span> <span class="o">*</span><span class="n">args</span><span class="p">:</span> <span class="n">Any</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">:</span> <span class="n">Any</span>
|
|
<a id="__codelineno-0-3" name="__codelineno-0-3" href="#api-waveguides-__codelineno-0-3"></a><span class="p">)</span> <span class="o">-></span> <span class="nb">tuple</span><span class="p">[</span><span class="n">vcfdfield2_t</span><span class="p">,</span> <span class="nb">complex</span><span class="p">]</span>
|
|
</code></pre></div>
|
|
|
|
<div class="doc doc-contents ">
|
|
|
|
<p>Wrapper around <code>solve_modes()</code> that solves for a single mode.</p>
|
|
|
|
|
|
<p><span class="doc-section-title">Parameters:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
<th>Default</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>mode_number</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#index-recommended-starting-points">int</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>0-indexed mode number to solve for</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>*args</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title="typing.Any" href="#typing.Any">Any</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>passed to <code>solve_modes()</code></p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<code>()</code>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>**kwargs</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title="typing.Any" href="#typing.Any">Any</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>passed to <code>solve_modes()</code></p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<code>{}</code>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
<p><span class="doc-section-title">Returns:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#tuple">tuple</a>[<a class="autorefs autorefs-internal" title="meanas.fdmath.vcfdfield2_t" href="#meanas.fdmath.vcfdfield2_t">vcfdfield2_t</a>, <a class="autorefs autorefs-internal" href="#complex">complex</a>]</code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>(e_xy, wavenumber)</p>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="doc doc-object doc-function">
|
|
|
|
|
|
<h3 id="api-waveguides-meanas.fdfd.waveguide_2d.inner_product" class="doc doc-heading">
|
|
<code class="doc-symbol doc-symbol-heading doc-symbol-function"></code> <span class="doc doc-object-name doc-function-name">inner_product</span>
|
|
|
|
|
|
<a href="#api-waveguides-meanas.fdfd.waveguide_2d.inner_product" class="headerlink" title="Permanent link">¶</a></h3>
|
|
<div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#api-waveguides-__codelineno-0-1"></a><span class="nf">inner_product</span><span class="p">(</span>
|
|
<a id="__codelineno-0-2" name="__codelineno-0-2" href="#api-waveguides-__codelineno-0-2"></a> <span class="n">e1</span><span class="p">:</span> <span class="n">vcfdfield2</span><span class="p">,</span>
|
|
<a id="__codelineno-0-3" name="__codelineno-0-3" href="#api-waveguides-__codelineno-0-3"></a> <span class="n">h2</span><span class="p">:</span> <span class="n">vcfdfield2</span><span class="p">,</span>
|
|
<a id="__codelineno-0-4" name="__codelineno-0-4" href="#api-waveguides-__codelineno-0-4"></a> <span class="n">dxes</span><span class="p">:</span> <span class="n">dx_lists2_t</span><span class="p">,</span>
|
|
<a id="__codelineno-0-5" name="__codelineno-0-5" href="#api-waveguides-__codelineno-0-5"></a> <span class="n">prop_phase</span><span class="p">:</span> <span class="nb">float</span> <span class="o">=</span> <span class="mi">0</span><span class="p">,</span>
|
|
<a id="__codelineno-0-6" name="__codelineno-0-6" href="#api-waveguides-__codelineno-0-6"></a> <span class="n">conj_h</span><span class="p">:</span> <span class="nb">bool</span> <span class="o">=</span> <span class="kc">False</span><span class="p">,</span>
|
|
<a id="__codelineno-0-7" name="__codelineno-0-7" href="#api-waveguides-__codelineno-0-7"></a> <span class="n">trapezoid</span><span class="p">:</span> <span class="nb">bool</span> <span class="o">=</span> <span class="kc">False</span><span class="p">,</span>
|
|
<a id="__codelineno-0-8" name="__codelineno-0-8" href="#api-waveguides-__codelineno-0-8"></a><span class="p">)</span> <span class="o">-></span> <span class="nb">complex</span>
|
|
</code></pre></div>
|
|
|
|
<div class="doc doc-contents ">
|
|
|
|
<p>Compute the discrete waveguide overlap / Poynting inner product.</p>
|
|
<p>This is the 2D transverse integral corresponding to the time-averaged
|
|
longitudinal Poynting flux,</p>
|
|
<div class="arithmatex">\[
|
|
\frac{1}{2}\int (E_x H_y - E_y H_x) \, dx \, dy
|
|
\]</div>
|
|
<p>with the Yee-grid staggering and optional propagation-phase adjustment used
|
|
by the waveguide helpers in this module.</p>
|
|
|
|
|
|
<p><span class="doc-section-title">Parameters:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
<th>Default</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>e1</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" vcfdfield2 (meanas.fdmath.vcfdfield2)" href="#api-fdmath-meanas.fdmath.types.vcfdfield2">vcfdfield2</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Vectorized electric field, typically from <code>exy2e(...)</code> or
|
|
<code>normalized_fields_e(...)</code>.</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>h2</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" vcfdfield2 (meanas.fdmath.vcfdfield2)" href="#api-fdmath-meanas.fdmath.types.vcfdfield2">vcfdfield2</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Vectorized magnetic field, typically from <code>hxy2h(...)</code>,
|
|
<code>exy2h(...)</code>, or one of the normalization helpers.</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>dxes</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" dx_lists2_t
|
|
|
|
|
|
|
|
module-attribute
|
|
(meanas.fdmath.dx_lists2_t)" href="#api-fdmath-meanas.fdmath.types.dx_lists2_t">dx_lists2_t</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Two-dimensional Yee-grid spacing lists <code>[dx_e, dx_h]</code>.</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>prop_phase</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#float">float</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Phase advance over one propagation cell. This is used to
|
|
shift the H field into the same longitudinal reference plane as the
|
|
E field.</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<code>0</code>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>conj_h</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#bool">bool</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Whether to conjugate <code>h2</code> before forming the overlap. Use
|
|
<code>True</code> for the usual time-averaged power normalization.</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<code>False</code>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>trapezoid</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#bool">bool</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Whether to use trapezoidal quadrature instead of the default
|
|
rectangular Yee-cell sum.</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<code>False</code>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
<p><span class="doc-section-title">Returns:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#complex">complex</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Complex overlap / longitudinal power integral.</p>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="doc doc-object doc-module">
|
|
|
|
|
|
|
|
<h2 id="api-waveguides-meanas.fdfd.waveguide_3d" class="doc doc-heading">
|
|
<code class="doc-symbol doc-symbol-heading doc-symbol-module"></code> <span class="doc doc-object-name doc-module-name">meanas.fdfd.waveguide_3d</span>
|
|
|
|
|
|
<a href="#api-waveguides-meanas.fdfd.waveguide_3d" class="headerlink" title="Permanent link">¶</a></h2>
|
|
|
|
<div class="doc doc-contents first">
|
|
|
|
<p>Tools for working with waveguide modes in 3D domains.</p>
|
|
<p>This module relies heavily on <code>waveguide_2d</code> and mostly just transforms
|
|
its parameters into 2D equivalents and expands the results back into 3D.</p>
|
|
<p>The intended workflow is:</p>
|
|
<ol>
|
|
<li>Select a single-cell slice normal to the propagation axis.</li>
|
|
<li>Solve the corresponding 2D mode problem with <code>solve_mode(...)</code>.</li>
|
|
<li>Turn that mode into a one-sided source with <code>compute_source(...)</code>.</li>
|
|
<li>Build an overlap window with <code>compute_overlap_e(...)</code> for port readout.</li>
|
|
</ol>
|
|
<p><code>polarity</code> is part of the public convention throughout this module:</p>
|
|
<ul>
|
|
<li><code>+1</code> means forward propagation toward increasing index along <code>axis</code></li>
|
|
<li><code>-1</code> means backward propagation toward decreasing index along <code>axis</code></li>
|
|
</ul>
|
|
<p>That same convention controls which side of the selected slice is used for the
|
|
overlap window and how the expanded field is phased.</p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="doc doc-children">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="doc doc-object doc-function">
|
|
|
|
|
|
<h3 id="api-waveguides-meanas.fdfd.waveguide_3d.solve_mode" class="doc doc-heading">
|
|
<code class="doc-symbol doc-symbol-heading doc-symbol-function"></code> <span class="doc doc-object-name doc-function-name">solve_mode</span>
|
|
|
|
|
|
<a href="#api-waveguides-meanas.fdfd.waveguide_3d.solve_mode" class="headerlink" title="Permanent link">¶</a></h3>
|
|
<div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#api-waveguides-__codelineno-0-1"></a><span class="nf">solve_mode</span><span class="p">(</span>
|
|
<a id="__codelineno-0-2" name="__codelineno-0-2" href="#api-waveguides-__codelineno-0-2"></a> <span class="n">mode_number</span><span class="p">:</span> <span class="nb">int</span><span class="p">,</span>
|
|
<a id="__codelineno-0-3" name="__codelineno-0-3" href="#api-waveguides-__codelineno-0-3"></a> <span class="n">omega</span><span class="p">:</span> <span class="nb">complex</span><span class="p">,</span>
|
|
<a id="__codelineno-0-4" name="__codelineno-0-4" href="#api-waveguides-__codelineno-0-4"></a> <span class="n">dxes</span><span class="p">:</span> <span class="n">dx_lists_t</span><span class="p">,</span>
|
|
<a id="__codelineno-0-5" name="__codelineno-0-5" href="#api-waveguides-__codelineno-0-5"></a> <span class="n">axis</span><span class="p">:</span> <span class="nb">int</span><span class="p">,</span>
|
|
<a id="__codelineno-0-6" name="__codelineno-0-6" href="#api-waveguides-__codelineno-0-6"></a> <span class="n">polarity</span><span class="p">:</span> <span class="nb">int</span><span class="p">,</span>
|
|
<a id="__codelineno-0-7" name="__codelineno-0-7" href="#api-waveguides-__codelineno-0-7"></a> <span class="n">slices</span><span class="p">:</span> <span class="n">Sequence</span><span class="p">[</span><span class="nb">slice</span><span class="p">],</span>
|
|
<a id="__codelineno-0-8" name="__codelineno-0-8" href="#api-waveguides-__codelineno-0-8"></a> <span class="n">epsilon</span><span class="p">:</span> <span class="n">fdfield</span><span class="p">,</span>
|
|
<a id="__codelineno-0-9" name="__codelineno-0-9" href="#api-waveguides-__codelineno-0-9"></a> <span class="n">mu</span><span class="p">:</span> <span class="n">fdfield</span> <span class="o">|</span> <span class="kc">None</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
|
|
<a id="__codelineno-0-10" name="__codelineno-0-10" href="#api-waveguides-__codelineno-0-10"></a><span class="p">)</span> <span class="o">-></span> <span class="nb">dict</span><span class="p">[</span><span class="nb">str</span><span class="p">,</span> <span class="nb">complex</span> <span class="o">|</span> <span class="n">NDArray</span><span class="p">[</span><span class="n">complexfloating</span><span class="p">]]</span>
|
|
</code></pre></div>
|
|
|
|
<div class="doc doc-contents ">
|
|
|
|
<p>Given a 3D grid, selects a slice from the grid and attempts to
|
|
solve for an eigenmode propagating through that slice.</p>
|
|
|
|
|
|
<p><span class="doc-section-title">Parameters:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
<th>Default</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>mode_number</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#index-recommended-starting-points">int</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Number of the mode, 0-indexed</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>omega</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#complex">complex</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Angular frequency of the simulation</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>dxes</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" dx_lists_t
|
|
|
|
|
|
|
|
module-attribute
|
|
(meanas.fdmath.dx_lists_t)" href="#api-fdmath-meanas.fdmath.types.dx_lists_t">dx_lists_t</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Grid parameters <code>[dx_e, dx_h]</code> as described in <code>meanas.fdmath.types</code></p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>axis</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#index-recommended-starting-points">int</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Propagation axis (0=x, 1=y, 2=z)</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>polarity</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#index-recommended-starting-points">int</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Propagation direction (+1 for +ve, -1 for -ve)</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>slices</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title="collections.abc.Sequence" href="#collections.abc.Sequence">Sequence</a>[<a class="autorefs autorefs-internal" href="#api-fdmath-meanas.fdmath.types.vfdslice">slice</a>]</code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p><code>epsilon[tuple(slices)]</code> is used to select the portion of the grid to use
|
|
as the waveguide cross-section. <code>slices[axis]</code> must select exactly one item.</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>epsilon</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" fdfield (meanas.fdmath.fdfield)" href="#api-fdmath-meanas.fdmath.types.fdfield">fdfield</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Dielectric constant</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>mu</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" fdfield (meanas.fdmath.fdfield)" href="#api-fdmath-meanas.fdmath.types.fdfield">fdfield</a> | None</code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Magnetic permeability (default 1 everywhere)</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<code>None</code>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
<p><span class="doc-section-title">Returns:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#dict">dict</a>[<a class="autorefs autorefs-internal" href="#api-fdmath-meanas.fdmath--datastructure-dx_lists_t">str</a>, <a class="autorefs autorefs-internal" href="#complex">complex</a> | <a class="autorefs autorefs-internal" title="numpy.typing.NDArray" href="#numpy.typing.NDArray">NDArray</a>[<a class="autorefs autorefs-internal" title="numpy.complexfloating" href="#numpy.complexfloating">complexfloating</a>]]</code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Dictionary containing:</p>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#dict">dict</a>[<a class="autorefs autorefs-internal" href="#api-fdmath-meanas.fdmath--datastructure-dx_lists_t">str</a>, <a class="autorefs autorefs-internal" href="#complex">complex</a> | <a class="autorefs autorefs-internal" title="numpy.typing.NDArray" href="#numpy.typing.NDArray">NDArray</a>[<a class="autorefs autorefs-internal" title="numpy.complexfloating" href="#numpy.complexfloating">complexfloating</a>]]</code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<ul>
|
|
<li><code>E</code>: full-grid electric field for the solved mode</li>
|
|
</ul>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#dict">dict</a>[<a class="autorefs autorefs-internal" href="#api-fdmath-meanas.fdmath--datastructure-dx_lists_t">str</a>, <a class="autorefs autorefs-internal" href="#complex">complex</a> | <a class="autorefs autorefs-internal" title="numpy.typing.NDArray" href="#numpy.typing.NDArray">NDArray</a>[<a class="autorefs autorefs-internal" title="numpy.complexfloating" href="#numpy.complexfloating">complexfloating</a>]]</code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<ul>
|
|
<li><code>H</code>: full-grid magnetic field for the solved mode</li>
|
|
</ul>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#dict">dict</a>[<a class="autorefs autorefs-internal" href="#api-fdmath-meanas.fdmath--datastructure-dx_lists_t">str</a>, <a class="autorefs autorefs-internal" href="#complex">complex</a> | <a class="autorefs autorefs-internal" title="numpy.typing.NDArray" href="#numpy.typing.NDArray">NDArray</a>[<a class="autorefs autorefs-internal" title="numpy.complexfloating" href="#numpy.complexfloating">complexfloating</a>]]</code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<ul>
|
|
<li><code>wavenumber</code>: propagation constant corrected for the discretized
|
|
propagation axis</li>
|
|
</ul>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#dict">dict</a>[<a class="autorefs autorefs-internal" href="#api-fdmath-meanas.fdmath--datastructure-dx_lists_t">str</a>, <a class="autorefs autorefs-internal" href="#complex">complex</a> | <a class="autorefs autorefs-internal" title="numpy.typing.NDArray" href="#numpy.typing.NDArray">NDArray</a>[<a class="autorefs autorefs-internal" title="numpy.complexfloating" href="#numpy.complexfloating">complexfloating</a>]]</code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<ul>
|
|
<li><code>wavenumber_2d</code>: propagation constant of the reduced 2D eigenproblem</li>
|
|
</ul>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
<details class="notes" open>
|
|
<summary>Notes</summary>
|
|
<p>The returned fields are normalized through the <code>waveguide_2d</code>
|
|
normalization convention before being expanded back to 3D.</p>
|
|
</details>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="doc doc-object doc-function">
|
|
|
|
|
|
<h3 id="api-waveguides-meanas.fdfd.waveguide_3d.compute_source" class="doc doc-heading">
|
|
<code class="doc-symbol doc-symbol-heading doc-symbol-function"></code> <span class="doc doc-object-name doc-function-name">compute_source</span>
|
|
|
|
|
|
<a href="#api-waveguides-meanas.fdfd.waveguide_3d.compute_source" class="headerlink" title="Permanent link">¶</a></h3>
|
|
<div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#api-waveguides-__codelineno-0-1"></a><span class="nf">compute_source</span><span class="p">(</span>
|
|
<a id="__codelineno-0-2" name="__codelineno-0-2" href="#api-waveguides-__codelineno-0-2"></a> <span class="n">E</span><span class="p">:</span> <span class="n">cfdfield</span><span class="p">,</span>
|
|
<a id="__codelineno-0-3" name="__codelineno-0-3" href="#api-waveguides-__codelineno-0-3"></a> <span class="n">wavenumber</span><span class="p">:</span> <span class="nb">complex</span><span class="p">,</span>
|
|
<a id="__codelineno-0-4" name="__codelineno-0-4" href="#api-waveguides-__codelineno-0-4"></a> <span class="n">omega</span><span class="p">:</span> <span class="nb">complex</span><span class="p">,</span>
|
|
<a id="__codelineno-0-5" name="__codelineno-0-5" href="#api-waveguides-__codelineno-0-5"></a> <span class="n">dxes</span><span class="p">:</span> <span class="n">dx_lists_t</span><span class="p">,</span>
|
|
<a id="__codelineno-0-6" name="__codelineno-0-6" href="#api-waveguides-__codelineno-0-6"></a> <span class="n">axis</span><span class="p">:</span> <span class="nb">int</span><span class="p">,</span>
|
|
<a id="__codelineno-0-7" name="__codelineno-0-7" href="#api-waveguides-__codelineno-0-7"></a> <span class="n">polarity</span><span class="p">:</span> <span class="nb">int</span><span class="p">,</span>
|
|
<a id="__codelineno-0-8" name="__codelineno-0-8" href="#api-waveguides-__codelineno-0-8"></a> <span class="n">slices</span><span class="p">:</span> <span class="n">Sequence</span><span class="p">[</span><span class="nb">slice</span><span class="p">],</span>
|
|
<a id="__codelineno-0-9" name="__codelineno-0-9" href="#api-waveguides-__codelineno-0-9"></a> <span class="n">epsilon</span><span class="p">:</span> <span class="n">fdfield</span><span class="p">,</span>
|
|
<a id="__codelineno-0-10" name="__codelineno-0-10" href="#api-waveguides-__codelineno-0-10"></a> <span class="n">mu</span><span class="p">:</span> <span class="n">fdfield</span> <span class="o">|</span> <span class="kc">None</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
|
|
<a id="__codelineno-0-11" name="__codelineno-0-11" href="#api-waveguides-__codelineno-0-11"></a><span class="p">)</span> <span class="o">-></span> <span class="n">cfdfield_t</span>
|
|
</code></pre></div>
|
|
|
|
<div class="doc doc-contents ">
|
|
|
|
<p>Given an eigenmode obtained by <code>solve_mode</code>, returns the current source distribution
|
|
necessary to position a unidirectional source at the slice location.</p>
|
|
|
|
|
|
<p><span class="doc-section-title">Parameters:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
<th>Default</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>E</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" cfdfield (meanas.fdmath.cfdfield)" href="#api-fdmath-meanas.fdmath.types.cfdfield">cfdfield</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>E-field of the mode</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>wavenumber</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#complex">complex</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Wavenumber of the mode</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>omega</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#complex">complex</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Angular frequency of the simulation</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>dxes</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" dx_lists_t
|
|
|
|
|
|
|
|
module-attribute
|
|
(meanas.fdmath.dx_lists_t)" href="#api-fdmath-meanas.fdmath.types.dx_lists_t">dx_lists_t</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Grid parameters <code>[dx_e, dx_h]</code> as described in <code>meanas.fdmath.types</code></p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>axis</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#index-recommended-starting-points">int</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Propagation axis (0=x, 1=y, 2=z)</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>polarity</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#index-recommended-starting-points">int</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Propagation direction (+1 for +ve, -1 for -ve)</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>slices</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title="collections.abc.Sequence" href="#collections.abc.Sequence">Sequence</a>[<a class="autorefs autorefs-internal" href="#api-fdmath-meanas.fdmath.types.vfdslice">slice</a>]</code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p><code>epsilon[tuple(slices)]</code> is used to select the portion of the grid to use
|
|
as the waveguide cross-section. <code>slices[axis]</code> should select only one item.</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>mu</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" fdfield (meanas.fdmath.fdfield)" href="#api-fdmath-meanas.fdmath.types.fdfield">fdfield</a> | None</code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Magnetic permeability (default 1 everywhere)</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<code>None</code>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
<p><span class="doc-section-title">Returns:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title="meanas.fdmath.cfdfield_t" href="#meanas.fdmath.cfdfield_t">cfdfield_t</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p><code>J</code> distribution for a one-sided electric-current source.</p>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
<details class="notes" open>
|
|
<summary>Notes</summary>
|
|
<p>The source is built from the expanded mode field and a boundary-source
|
|
operator. The resulting current is intended to be injected with the
|
|
same sign convention used elsewhere in the package:</p>
|
|
<p><code>E -= dt * J / epsilon</code></p>
|
|
</details>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="doc doc-object doc-function">
|
|
|
|
|
|
<h3 id="api-waveguides-meanas.fdfd.waveguide_3d.compute_overlap_e" class="doc doc-heading">
|
|
<code class="doc-symbol doc-symbol-heading doc-symbol-function"></code> <span class="doc doc-object-name doc-function-name">compute_overlap_e</span>
|
|
|
|
|
|
<a href="#api-waveguides-meanas.fdfd.waveguide_3d.compute_overlap_e" class="headerlink" title="Permanent link">¶</a></h3>
|
|
<div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#api-waveguides-__codelineno-0-1"></a><span class="nf">compute_overlap_e</span><span class="p">(</span>
|
|
<a id="__codelineno-0-2" name="__codelineno-0-2" href="#api-waveguides-__codelineno-0-2"></a> <span class="n">E</span><span class="p">:</span> <span class="n">cfdfield_t</span><span class="p">,</span>
|
|
<a id="__codelineno-0-3" name="__codelineno-0-3" href="#api-waveguides-__codelineno-0-3"></a> <span class="n">wavenumber</span><span class="p">:</span> <span class="nb">complex</span><span class="p">,</span>
|
|
<a id="__codelineno-0-4" name="__codelineno-0-4" href="#api-waveguides-__codelineno-0-4"></a> <span class="n">dxes</span><span class="p">:</span> <span class="n">dx_lists_t</span><span class="p">,</span>
|
|
<a id="__codelineno-0-5" name="__codelineno-0-5" href="#api-waveguides-__codelineno-0-5"></a> <span class="n">axis</span><span class="p">:</span> <span class="nb">int</span><span class="p">,</span>
|
|
<a id="__codelineno-0-6" name="__codelineno-0-6" href="#api-waveguides-__codelineno-0-6"></a> <span class="n">polarity</span><span class="p">:</span> <span class="nb">int</span><span class="p">,</span>
|
|
<a id="__codelineno-0-7" name="__codelineno-0-7" href="#api-waveguides-__codelineno-0-7"></a> <span class="n">slices</span><span class="p">:</span> <span class="n">Sequence</span><span class="p">[</span><span class="nb">slice</span><span class="p">],</span>
|
|
<a id="__codelineno-0-8" name="__codelineno-0-8" href="#api-waveguides-__codelineno-0-8"></a> <span class="n">omega</span><span class="p">:</span> <span class="nb">float</span><span class="p">,</span>
|
|
<a id="__codelineno-0-9" name="__codelineno-0-9" href="#api-waveguides-__codelineno-0-9"></a><span class="p">)</span> <span class="o">-></span> <span class="n">cfdfield_t</span>
|
|
</code></pre></div>
|
|
|
|
<div class="doc doc-contents ">
|
|
|
|
<p>Build an overlap field for projecting another 3D electric field onto a mode.</p>
|
|
<p>The returned field is intended for the discrete overlap expression</p>
|
|
<div class="arithmatex">\[
|
|
\sum \mathrm{overlap\_e} \; E_\mathrm{other}^*
|
|
\]</div>
|
|
<p>where the sum is over the full Yee-grid field storage.</p>
|
|
<p>The construction uses a two-cell window immediately upstream of the selected
|
|
slice:</p>
|
|
<ul>
|
|
<li>for <code>polarity=+1</code>, the two cells just before <code>slices[axis].start</code></li>
|
|
<li>for <code>polarity=-1</code>, the two cells just after <code>slices[axis].stop</code></li>
|
|
</ul>
|
|
<p>The window is clipped to the simulation domain if necessary. A clipped but
|
|
non-empty window raises <code>RuntimeWarning</code>; an empty window raises
|
|
<code>ValueError</code>.</p>
|
|
<p>The derivation below assumes reflection symmetry and the standard waveguide
|
|
overlap relation involving</p>
|
|
<div class="arithmatex">\[
|
|
\int ((E \times H_\mathrm{mode}) + (E_\mathrm{mode} \times H)) \cdot dn.
|
|
\]</div>
|
|
<p>E x H_mode + E_mode x H
|
|
-> Ex Hmy - EyHmx + Emx Hy - Emy Hx (Z-prop)
|
|
Ex we/B Emx + Ex i/B dy Hmz - Ey (-we/B Emy) - Ey i/B dx Hmz
|
|
we/B (Ex Emx + Ey Emy) + i/B (Ex dy Hmz - Ey dx Hmz)
|
|
we/B (Ex Emx + Ey Emy) + i/B (Ex dy (dx Emy - dy Emx) - Ey dx (dx Emy - dy Emx))
|
|
we/B (Ex Emx + Ey Emy) + i/B (Ex dy dx Emy - Ex dy dy Emx - Ey dx dx Emy - Ey dx dy Emx)</p>
|
|
<p>Ex j/wu (-jB Emx - dx Emz) - Ey j/wu (dy Emz + jB Emy)
|
|
B/wu (Ex Emx + Ey Emy) - j/wu (Ex dx Emz + Ey dy Emz)</p>
|
|
|
|
|
|
<p><span class="doc-section-title">Parameters:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
<th>Default</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>E</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title="meanas.fdmath.cfdfield_t" href="#meanas.fdmath.cfdfield_t">cfdfield_t</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>E-field of the mode</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>wavenumber</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#complex">complex</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Wavenumber of the mode</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>dxes</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" dx_lists_t
|
|
|
|
|
|
|
|
module-attribute
|
|
(meanas.fdmath.dx_lists_t)" href="#api-fdmath-meanas.fdmath.types.dx_lists_t">dx_lists_t</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Grid parameters <code>[dx_e, dx_h]</code> as described in <code>meanas.fdmath.types</code></p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>axis</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#index-recommended-starting-points">int</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Propagation axis (0=x, 1=y, 2=z)</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>polarity</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#index-recommended-starting-points">int</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Propagation direction (+1 for +ve, -1 for -ve)</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>slices</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title="collections.abc.Sequence" href="#collections.abc.Sequence">Sequence</a>[<a class="autorefs autorefs-internal" href="#api-fdmath-meanas.fdmath.types.vfdslice">slice</a>]</code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p><code>epsilon[tuple(slices)]</code> is used to select the portion of the grid to use
|
|
as the waveguide cross-section. slices[axis] should select only one item.</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
<p><span class="doc-section-title">Returns:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title="meanas.fdmath.cfdfield_t" href="#meanas.fdmath.cfdfield_t">cfdfield_t</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p><code>overlap_e</code> normalized so that <code>numpy.sum(overlap_e * E.conj()) == 1</code></p>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title="meanas.fdmath.cfdfield_t" href="#meanas.fdmath.cfdfield_t">cfdfield_t</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>over the retained overlap window.</p>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="doc doc-object doc-function">
|
|
|
|
|
|
<h3 id="api-waveguides-meanas.fdfd.waveguide_3d.expand_e" class="doc doc-heading">
|
|
<code class="doc-symbol doc-symbol-heading doc-symbol-function"></code> <span class="doc doc-object-name doc-function-name">expand_e</span>
|
|
|
|
|
|
<a href="#api-waveguides-meanas.fdfd.waveguide_3d.expand_e" class="headerlink" title="Permanent link">¶</a></h3>
|
|
<div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#api-waveguides-__codelineno-0-1"></a><span class="nf">expand_e</span><span class="p">(</span>
|
|
<a id="__codelineno-0-2" name="__codelineno-0-2" href="#api-waveguides-__codelineno-0-2"></a> <span class="n">E</span><span class="p">:</span> <span class="n">cfdfield</span><span class="p">,</span>
|
|
<a id="__codelineno-0-3" name="__codelineno-0-3" href="#api-waveguides-__codelineno-0-3"></a> <span class="n">wavenumber</span><span class="p">:</span> <span class="nb">complex</span><span class="p">,</span>
|
|
<a id="__codelineno-0-4" name="__codelineno-0-4" href="#api-waveguides-__codelineno-0-4"></a> <span class="n">dxes</span><span class="p">:</span> <span class="n">dx_lists_t</span><span class="p">,</span>
|
|
<a id="__codelineno-0-5" name="__codelineno-0-5" href="#api-waveguides-__codelineno-0-5"></a> <span class="n">axis</span><span class="p">:</span> <span class="nb">int</span><span class="p">,</span>
|
|
<a id="__codelineno-0-6" name="__codelineno-0-6" href="#api-waveguides-__codelineno-0-6"></a> <span class="n">polarity</span><span class="p">:</span> <span class="nb">int</span><span class="p">,</span>
|
|
<a id="__codelineno-0-7" name="__codelineno-0-7" href="#api-waveguides-__codelineno-0-7"></a> <span class="n">slices</span><span class="p">:</span> <span class="n">Sequence</span><span class="p">[</span><span class="nb">slice</span><span class="p">],</span>
|
|
<a id="__codelineno-0-8" name="__codelineno-0-8" href="#api-waveguides-__codelineno-0-8"></a><span class="p">)</span> <span class="o">-></span> <span class="n">cfdfield_t</span>
|
|
</code></pre></div>
|
|
|
|
<div class="doc doc-contents ">
|
|
|
|
<p>Given an eigenmode obtained by <code>solve_mode</code>, expands the E-field from the 2D
|
|
slice where the mode was calculated to the entire domain (along the propagation
|
|
axis). This assumes the epsilon cross-section remains constant throughout the
|
|
entire domain; it is up to the caller to truncate the expansion to any regions
|
|
where it is valid.</p>
|
|
|
|
|
|
<p><span class="doc-section-title">Parameters:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
<th>Default</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>E</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" cfdfield (meanas.fdmath.cfdfield)" href="#api-fdmath-meanas.fdmath.types.cfdfield">cfdfield</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>E-field of the mode</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>wavenumber</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#complex">complex</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Wavenumber of the mode</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>dxes</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" dx_lists_t
|
|
|
|
|
|
|
|
module-attribute
|
|
(meanas.fdmath.dx_lists_t)" href="#api-fdmath-meanas.fdmath.types.dx_lists_t">dx_lists_t</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Grid parameters <code>[dx_e, dx_h]</code> as described in <code>meanas.fdmath.types</code></p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>axis</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#index-recommended-starting-points">int</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Propagation axis (0=x, 1=y, 2=z)</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>polarity</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#index-recommended-starting-points">int</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Propagation direction (+1 for +ve, -1 for -ve)</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>slices</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title="collections.abc.Sequence" href="#collections.abc.Sequence">Sequence</a>[<a class="autorefs autorefs-internal" href="#api-fdmath-meanas.fdmath.types.vfdslice">slice</a>]</code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p><code>epsilon[tuple(slices)]</code> is used to select the portion of the grid to use
|
|
as the waveguide cross-section. slices[axis] should select only one item.</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
<p><span class="doc-section-title">Returns:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title="meanas.fdmath.cfdfield_t" href="#meanas.fdmath.cfdfield_t">cfdfield_t</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p><code>E</code>, with the original field expanded along the specified <code>axis</code>.</p>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
<details class="notes" open>
|
|
<summary>Notes</summary>
|
|
<p>This helper assumes that the waveguide cross-section remains constant
|
|
along the propagation axis and applies the phase factor</p>
|
|
<div class="arithmatex">\[
|
|
e^{-i \, \mathrm{polarity} \, wavenumber \, \Delta z}
|
|
\]</div>
|
|
<p>to each copied slice.</p>
|
|
</details>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="doc doc-object doc-module">
|
|
|
|
|
|
|
|
<h2 id="api-waveguides-meanas.fdfd.waveguide_cyl" class="doc doc-heading">
|
|
<code class="doc-symbol doc-symbol-heading doc-symbol-module"></code> <span class="doc doc-object-name doc-module-name">meanas.fdfd.waveguide_cyl</span>
|
|
|
|
|
|
<a href="#api-waveguides-meanas.fdfd.waveguide_cyl" class="headerlink" title="Permanent link">¶</a></h2>
|
|
|
|
<div class="doc doc-contents first">
|
|
|
|
<p>Operators and helper functions for cylindrical waveguides with unchanging cross-section.</p>
|
|
<p>Waveguide operator is derived according to 10.1364/OL.33.001848.</p>
|
|
<p>As in <code>waveguide_2d</code>, the propagation dependence is separated from the
|
|
transverse solve. Here the propagation coordinate is the bend angle <code>\theta</code>,
|
|
and the fields are assumed to have the form</p>
|
|
<div class="arithmatex">\[
|
|
\vec{E}(r, y, \theta), \vec{H}(r, y, \theta) \propto e^{-\imath m \theta},
|
|
\]</div>
|
|
<p>where <code>m</code> is the angular wavenumber returned by <code>solve_mode(s)</code>. It is often
|
|
convenient to introduce the corresponding linear wavenumber</p>
|
|
<div class="arithmatex">\[
|
|
\beta = \frac{m}{r_{\min}},
|
|
\]</div>
|
|
<p>so that the cylindrical problem resembles the straight-waveguide problem with
|
|
additional metric factors.</p>
|
|
<p>Those metric factors live on the staggered radial Yee grids. If the left edge of
|
|
the computational window is at <code>r = r_{\min}</code>, define the electric-grid and
|
|
magnetic-grid radial sample locations by</p>
|
|
<div class="arithmatex">\[
|
|
\begin{aligned}
|
|
r_a(n) &= r_{\min} + \sum_{j \le n} \Delta r_{e, j}, \\
|
|
r_b\!\left(n + \tfrac{1}{2}\right) &= r_{\min} + \tfrac{1}{2}\Delta r_{e, n}
|
|
+ \sum_{j < n} \Delta r_{h, j},
|
|
\end{aligned}
|
|
\]</div>
|
|
<p>and from them the diagonal metric matrices</p>
|
|
<div class="arithmatex">\[
|
|
\begin{aligned}
|
|
T_a &= \operatorname{diag}(r_a / r_{\min}), \\
|
|
T_b &= \operatorname{diag}(r_b / r_{\min}).
|
|
\end{aligned}
|
|
\]</div>
|
|
<p>With the same forward/backward derivative notation used in <code>waveguide_2d</code>, the
|
|
coordinate-transformed discrete curl equations used here are</p>
|
|
<div class="arithmatex">\[
|
|
\begin{aligned}
|
|
-\imath \omega \mu_{rr} H_r &= \tilde{\partial}_y E_z + \imath \beta T_a^{-1} E_y, \\
|
|
-\imath \omega \mu_{yy} H_y &= -\imath \beta T_b^{-1} E_r
|
|
- T_b^{-1} \tilde{\partial}_r (T_a E_z), \\
|
|
-\imath \omega \mu_{zz} H_z &= \tilde{\partial}_r E_y - \tilde{\partial}_y E_r, \\
|
|
\imath \beta H_y &= -\imath \omega T_b \epsilon_{rr} E_r - T_b \hat{\partial}_y H_z, \\
|
|
\imath \beta H_r &= \imath \omega T_a \epsilon_{yy} E_y
|
|
- T_b T_a^{-1} \hat{\partial}_r (T_b H_z), \\
|
|
\imath \omega E_z &= T_a \epsilon_{zz}^{-1}
|
|
\left(\hat{\partial}_r H_y - \hat{\partial}_y H_r\right).
|
|
\end{aligned}
|
|
\]</div>
|
|
<p>The first three equations are the cylindrical analogue of the straight-guide
|
|
relations for <code>H_r</code>, <code>H_y</code>, and <code>H_z</code>. The next two are the metric-weighted
|
|
versions of the straight-guide identities for <code>\imath \beta H_y</code> and
|
|
<code>\imath \beta H_r</code>, and the last equation plays the same role as the
|
|
longitudinal <code>E_z</code> reconstruction in <code>waveguide_2d</code>.</p>
|
|
<p>Following the same elimination steps as in <code>waveguide_2d</code>, apply
|
|
<code>\imath \beta \tilde{\partial}_r</code> and <code>\imath \beta \tilde{\partial}_y</code> to the
|
|
equation for <code>E_z</code>, substitute for <code>\imath \beta H_r</code> and <code>\imath \beta H_y</code>,
|
|
and then eliminate <code>H_z</code> with</p>
|
|
<div class="arithmatex">\[
|
|
H_z = \frac{1}{-\imath \omega \mu_{zz}}
|
|
\left(\tilde{\partial}_r E_y - \tilde{\partial}_y E_r\right).
|
|
\]</div>
|
|
<p>This yields the transverse electric eigenproblem implemented by
|
|
<code>cylindrical_operator(...)</code>:</p>
|
|
<div class="arithmatex">\[
|
|
\beta^2
|
|
\begin{bmatrix} E_r \\ E_y \end{bmatrix}
|
|
=
|
|
\left(
|
|
\omega^2
|
|
\begin{bmatrix}
|
|
T_b^2 \mu_{yy} \epsilon_{xx} & 0 \\
|
|
0 & T_a^2 \mu_{xx} \epsilon_{yy}
|
|
\end{bmatrix}
|
|
+
|
|
\begin{bmatrix}
|
|
-T_b \mu_{yy} \hat{\partial}_y \\
|
|
T_a \mu_{xx} \hat{\partial}_x
|
|
\end{bmatrix}
|
|
T_b \mu_{zz}^{-1}
|
|
\begin{bmatrix}
|
|
-\tilde{\partial}_y & \tilde{\partial}_x
|
|
\end{bmatrix}
|
|
+
|
|
\begin{bmatrix}
|
|
\tilde{\partial}_x \\
|
|
\tilde{\partial}_y
|
|
\end{bmatrix}
|
|
T_a \epsilon_{zz}^{-1}
|
|
\begin{bmatrix}
|
|
\hat{\partial}_x T_b \epsilon_{xx} &
|
|
\hat{\partial}_y T_a \epsilon_{yy}
|
|
\end{bmatrix}
|
|
\right)
|
|
\begin{bmatrix} E_r \\ E_y \end{bmatrix}.
|
|
\]</div>
|
|
<p>Since <code>\beta = m / r_{\min}</code>, the solver implemented in this file returns the
|
|
angular wavenumber <code>m</code>, while the operator itself is most naturally written in
|
|
terms of the linear quantity <code>\beta</code>. The helpers below reconstruct the full
|
|
field components from the solved transverse eigenvector and then normalize the
|
|
mode to unit forward power with the same discrete longitudinal Poynting inner
|
|
product used by <code>waveguide_2d</code>.</p>
|
|
<p>As in the straight-waveguide case, all functions here assume a 2D grid:</p>
|
|
<p><code>dxes = [[[dr_e_0, dr_e_1, ...], [dy_e_0, ...]], [[dr_h_0, ...], [dy_h_0, ...]]]</code>.</p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="doc doc-children">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="doc doc-object doc-function">
|
|
|
|
|
|
<h3 id="api-waveguides-meanas.fdfd.waveguide_cyl.cylindrical_operator" class="doc doc-heading">
|
|
<code class="doc-symbol doc-symbol-heading doc-symbol-function"></code> <span class="doc doc-object-name doc-function-name">cylindrical_operator</span>
|
|
|
|
|
|
<a href="#api-waveguides-meanas.fdfd.waveguide_cyl.cylindrical_operator" class="headerlink" title="Permanent link">¶</a></h3>
|
|
<div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#api-waveguides-__codelineno-0-1"></a><span class="nf">cylindrical_operator</span><span class="p">(</span>
|
|
<a id="__codelineno-0-2" name="__codelineno-0-2" href="#api-waveguides-__codelineno-0-2"></a> <span class="n">omega</span><span class="p">:</span> <span class="nb">float</span><span class="p">,</span>
|
|
<a id="__codelineno-0-3" name="__codelineno-0-3" href="#api-waveguides-__codelineno-0-3"></a> <span class="n">dxes</span><span class="p">:</span> <span class="n">dx_lists2_t</span><span class="p">,</span>
|
|
<a id="__codelineno-0-4" name="__codelineno-0-4" href="#api-waveguides-__codelineno-0-4"></a> <span class="n">epsilon</span><span class="p">:</span> <span class="n">vfdslice</span><span class="p">,</span>
|
|
<a id="__codelineno-0-5" name="__codelineno-0-5" href="#api-waveguides-__codelineno-0-5"></a> <span class="n">rmin</span><span class="p">:</span> <span class="nb">float</span><span class="p">,</span>
|
|
<a id="__codelineno-0-6" name="__codelineno-0-6" href="#api-waveguides-__codelineno-0-6"></a><span class="p">)</span> <span class="o">-></span> <span class="n">sparse</span><span class="o">.</span><span class="n">sparray</span>
|
|
</code></pre></div>
|
|
|
|
<div class="doc doc-contents ">
|
|
|
|
<p>Cylindrical coordinate waveguide operator of the form</p>
|
|
<div class="arithmatex">\[
|
|
(\omega^2 \begin{bmatrix} T_b T_b \mu_{yy} \epsilon_{xx} & 0 \\
|
|
0 & T_a T_a \mu_{xx} \epsilon_{yy} \end{bmatrix} +
|
|
\begin{bmatrix} -T_b \mu_{yy} \hat{\partial}_y \\
|
|
T_a \mu_{xx} \hat{\partial}_x \end{bmatrix} T_b \mu_{zz}^{-1}
|
|
\begin{bmatrix} -\tilde{\partial}_y & \tilde{\partial}_x \end{bmatrix} +
|
|
\begin{bmatrix} \tilde{\partial}_x \\
|
|
\tilde{\partial}_y \end{bmatrix} T_a \epsilon_{zz}^{-1}
|
|
\begin{bmatrix} \hat{\partial}_x T_b \epsilon_{xx} & \hat{\partial}_y T_a \epsilon_{yy} \end{bmatrix})
|
|
\begin{bmatrix} E_r \\
|
|
E_y \end{bmatrix}
|
|
\]</div>
|
|
<p>for use with a field vector of the form <code>[E_r, E_y]</code>.</p>
|
|
<p>This operator can be used to form an eigenvalue problem of the form
|
|
A @ [E_r, E_y] = beta**2 * [E_r, E_y]</p>
|
|
<p>which can then be solved for the eigenmodes of the system
|
|
(an <code>exp(-i * angular_wavenumber * theta)</code> theta-dependence is assumed for
|
|
the fields, with <code>beta = angular_wavenumber / rmin</code>).</p>
|
|
<p>(NOTE: See module docs and 10.1364/OL.33.001848)</p>
|
|
|
|
|
|
<p><span class="doc-section-title">Parameters:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
<th>Default</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>omega</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#float">float</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>The angular frequency of the system</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>dxes</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" dx_lists2_t
|
|
|
|
|
|
|
|
module-attribute
|
|
(meanas.fdmath.dx_lists2_t)" href="#api-fdmath-meanas.fdmath.types.dx_lists2_t">dx_lists2_t</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Grid parameters <code>[dx_e, dx_h]</code> as described in <code>meanas.fdmath.types</code> (2D)</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>epsilon</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" vfdslice (meanas.fdmath.vfdslice)" href="#api-fdmath-meanas.fdmath.types.vfdslice">vfdslice</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Vectorized dielectric constant grid</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>rmin</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#float">float</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Radius at the left edge of the simulation domain (at minimum 'x')</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
<p><span class="doc-section-title">Returns:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title="scipy.sparse.sparray" href="#scipy.sparse.sparray">sparray</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Sparse matrix representation of the operator</p>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="doc doc-object doc-function">
|
|
|
|
|
|
<h3 id="api-waveguides-meanas.fdfd.waveguide_cyl.solve_modes" class="doc doc-heading">
|
|
<code class="doc-symbol doc-symbol-heading doc-symbol-function"></code> <span class="doc doc-object-name doc-function-name">solve_modes</span>
|
|
|
|
|
|
<a href="#api-waveguides-meanas.fdfd.waveguide_cyl.solve_modes" class="headerlink" title="Permanent link">¶</a></h3>
|
|
<div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#api-waveguides-__codelineno-0-1"></a><span class="nf">solve_modes</span><span class="p">(</span>
|
|
<a id="__codelineno-0-2" name="__codelineno-0-2" href="#api-waveguides-__codelineno-0-2"></a> <span class="n">mode_numbers</span><span class="p">:</span> <span class="n">Sequence</span><span class="p">[</span><span class="nb">int</span><span class="p">],</span>
|
|
<a id="__codelineno-0-3" name="__codelineno-0-3" href="#api-waveguides-__codelineno-0-3"></a> <span class="n">omega</span><span class="p">:</span> <span class="nb">float</span><span class="p">,</span>
|
|
<a id="__codelineno-0-4" name="__codelineno-0-4" href="#api-waveguides-__codelineno-0-4"></a> <span class="n">dxes</span><span class="p">:</span> <span class="n">dx_lists2_t</span><span class="p">,</span>
|
|
<a id="__codelineno-0-5" name="__codelineno-0-5" href="#api-waveguides-__codelineno-0-5"></a> <span class="n">epsilon</span><span class="p">:</span> <span class="n">vfdslice</span><span class="p">,</span>
|
|
<a id="__codelineno-0-6" name="__codelineno-0-6" href="#api-waveguides-__codelineno-0-6"></a> <span class="n">rmin</span><span class="p">:</span> <span class="nb">float</span><span class="p">,</span>
|
|
<a id="__codelineno-0-7" name="__codelineno-0-7" href="#api-waveguides-__codelineno-0-7"></a> <span class="n">mode_margin</span><span class="p">:</span> <span class="nb">int</span> <span class="o">=</span> <span class="mi">2</span><span class="p">,</span>
|
|
<a id="__codelineno-0-8" name="__codelineno-0-8" href="#api-waveguides-__codelineno-0-8"></a><span class="p">)</span> <span class="o">-></span> <span class="nb">tuple</span><span class="p">[</span>
|
|
<a id="__codelineno-0-9" name="__codelineno-0-9" href="#api-waveguides-__codelineno-0-9"></a> <span class="n">NDArray</span><span class="p">[</span><span class="n">numpy</span><span class="o">.</span><span class="n">complex128</span><span class="p">],</span> <span class="n">NDArray</span><span class="p">[</span><span class="n">numpy</span><span class="o">.</span><span class="n">complex128</span><span class="p">]</span>
|
|
<a id="__codelineno-0-10" name="__codelineno-0-10" href="#api-waveguides-__codelineno-0-10"></a><span class="p">]</span>
|
|
</code></pre></div>
|
|
|
|
<div class="doc doc-contents ">
|
|
|
|
<p>Given a 2d (r, y) slice of epsilon, attempts to solve for the eigenmode
|
|
of the bent waveguide with the specified mode number.</p>
|
|
|
|
|
|
<p><span class="doc-section-title">Parameters:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
<th>Default</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>mode_number</code>
|
|
</td>
|
|
<td>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Number of the mode, 0-indexed</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>omega</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#float">float</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Angular frequency of the simulation</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>dxes</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" dx_lists2_t
|
|
|
|
|
|
|
|
module-attribute
|
|
(meanas.fdmath.dx_lists2_t)" href="#api-fdmath-meanas.fdmath.types.dx_lists2_t">dx_lists2_t</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Grid parameters [dx_e, dx_h] as described in meanas.fdmath.types.
|
|
The first coordinate is assumed to be r, the second is y.</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>epsilon</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" vfdslice (meanas.fdmath.vfdslice)" href="#api-fdmath-meanas.fdmath.types.vfdslice">vfdslice</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Dielectric constant</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>rmin</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#float">float</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Radius of curvature for the simulation. This should be the minimum value of
|
|
r within the simulation domain.</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
<p><span class="doc-section-title">Returns:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th> <th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td><code>e_xys</code></td> <td>
|
|
<code><a class="autorefs autorefs-internal" title="numpy.typing.NDArray" href="#numpy.typing.NDArray">NDArray</a>[<a class="autorefs autorefs-internal" title="numpy.complex128" href="#numpy.complex128">complex128</a>]</code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>NDArray of vfdfield_t specifying fields. First dimension is mode number.</p>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td><code>angular_wavenumbers</code></td> <td>
|
|
<code><a class="autorefs autorefs-internal" title="numpy.typing.NDArray" href="#numpy.typing.NDArray">NDArray</a>[<a class="autorefs autorefs-internal" title="numpy.complex128" href="#numpy.complex128">complex128</a>]</code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>list of wavenumbers in 1/rad units.</p>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="doc doc-object doc-function">
|
|
|
|
|
|
<h3 id="api-waveguides-meanas.fdfd.waveguide_cyl.solve_mode" class="doc doc-heading">
|
|
<code class="doc-symbol doc-symbol-heading doc-symbol-function"></code> <span class="doc doc-object-name doc-function-name">solve_mode</span>
|
|
|
|
|
|
<a href="#api-waveguides-meanas.fdfd.waveguide_cyl.solve_mode" class="headerlink" title="Permanent link">¶</a></h3>
|
|
<div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#api-waveguides-__codelineno-0-1"></a><span class="nf">solve_mode</span><span class="p">(</span>
|
|
<a id="__codelineno-0-2" name="__codelineno-0-2" href="#api-waveguides-__codelineno-0-2"></a> <span class="n">mode_number</span><span class="p">:</span> <span class="nb">int</span><span class="p">,</span> <span class="o">*</span><span class="n">args</span><span class="p">:</span> <span class="n">Any</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">:</span> <span class="n">Any</span>
|
|
<a id="__codelineno-0-3" name="__codelineno-0-3" href="#api-waveguides-__codelineno-0-3"></a><span class="p">)</span> <span class="o">-></span> <span class="nb">tuple</span><span class="p">[</span><span class="n">vcfdslice</span><span class="p">,</span> <span class="nb">complex</span><span class="p">]</span>
|
|
</code></pre></div>
|
|
|
|
<div class="doc doc-contents ">
|
|
|
|
<p>Wrapper around <code>solve_modes()</code> that solves for a single mode.</p>
|
|
|
|
|
|
<p><span class="doc-section-title">Parameters:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
<th>Default</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>mode_number</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#index-recommended-starting-points">int</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>0-indexed mode number to solve for</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>*args</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title="typing.Any" href="#typing.Any">Any</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>passed to <code>solve_modes()</code></p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<code>()</code>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>**kwargs</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title="typing.Any" href="#typing.Any">Any</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>passed to <code>solve_modes()</code></p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<code>{}</code>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
<p><span class="doc-section-title">Returns:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#tuple">tuple</a>[<a class="autorefs autorefs-internal" title=" vcfdslice (meanas.fdmath.vcfdslice)" href="#api-fdmath-meanas.fdmath.types.vcfdslice">vcfdslice</a>, <a class="autorefs autorefs-internal" href="#complex">complex</a>]</code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>(e_xy, angular_wavenumber)</p>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="doc doc-object doc-function">
|
|
|
|
|
|
<h3 id="api-waveguides-meanas.fdfd.waveguide_cyl.linear_wavenumbers" class="doc doc-heading">
|
|
<code class="doc-symbol doc-symbol-heading doc-symbol-function"></code> <span class="doc doc-object-name doc-function-name">linear_wavenumbers</span>
|
|
|
|
|
|
<a href="#api-waveguides-meanas.fdfd.waveguide_cyl.linear_wavenumbers" class="headerlink" title="Permanent link">¶</a></h3>
|
|
<div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#api-waveguides-__codelineno-0-1"></a><span class="nf">linear_wavenumbers</span><span class="p">(</span>
|
|
<a id="__codelineno-0-2" name="__codelineno-0-2" href="#api-waveguides-__codelineno-0-2"></a> <span class="n">e_xys</span><span class="p">:</span> <span class="nb">list</span><span class="p">[</span><span class="n">vcfdfield2_t</span><span class="p">],</span>
|
|
<a id="__codelineno-0-3" name="__codelineno-0-3" href="#api-waveguides-__codelineno-0-3"></a> <span class="n">angular_wavenumbers</span><span class="p">:</span> <span class="n">ArrayLike</span><span class="p">,</span>
|
|
<a id="__codelineno-0-4" name="__codelineno-0-4" href="#api-waveguides-__codelineno-0-4"></a> <span class="n">epsilon</span><span class="p">:</span> <span class="n">vfdslice</span><span class="p">,</span>
|
|
<a id="__codelineno-0-5" name="__codelineno-0-5" href="#api-waveguides-__codelineno-0-5"></a> <span class="n">dxes</span><span class="p">:</span> <span class="n">dx_lists2_t</span><span class="p">,</span>
|
|
<a id="__codelineno-0-6" name="__codelineno-0-6" href="#api-waveguides-__codelineno-0-6"></a> <span class="n">rmin</span><span class="p">:</span> <span class="nb">float</span><span class="p">,</span>
|
|
<a id="__codelineno-0-7" name="__codelineno-0-7" href="#api-waveguides-__codelineno-0-7"></a><span class="p">)</span> <span class="o">-></span> <span class="n">NDArray</span><span class="p">[</span><span class="n">numpy</span><span class="o">.</span><span class="n">complex128</span><span class="p">]</span>
|
|
</code></pre></div>
|
|
|
|
<div class="doc doc-contents ">
|
|
|
|
<p>Calculate linear wavenumbers (1/distance) based on angular wavenumbers (1/rad)
|
|
and the mode's energy distribution.</p>
|
|
|
|
|
|
<p><span class="doc-section-title">Parameters:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
<th>Default</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>e_xys</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#api-fdmath-meanas.fdmath.types.dx_lists_mut">list</a>[<a class="autorefs autorefs-internal" title="meanas.fdmath.vcfdfield2_t" href="#meanas.fdmath.vcfdfield2_t">vcfdfield2_t</a>]</code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Vectorized mode fields with shape (num_modes, 2 * x *y)</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>angular_wavenumbers</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title="numpy.typing.ArrayLike" href="#numpy.typing.ArrayLike">ArrayLike</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Wavenumbers assuming fields have theta-dependence of
|
|
<code>exp(-i * angular_wavenumber * theta)</code>. They should satisfy
|
|
<code>operator_e() @ e_xy == (angular_wavenumber / rmin) ** 2 * e_xy</code></p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>epsilon</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" vfdslice (meanas.fdmath.vfdslice)" href="#api-fdmath-meanas.fdmath.types.vfdslice">vfdslice</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Vectorized dielectric constant grid with shape (3, x, y)</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>dxes</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" dx_lists2_t
|
|
|
|
|
|
|
|
module-attribute
|
|
(meanas.fdmath.dx_lists2_t)" href="#api-fdmath-meanas.fdmath.types.dx_lists2_t">dx_lists2_t</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Grid parameters <code>[dx_e, dx_h]</code> as described in <code>meanas.fdmath.types</code> (2D)</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>rmin</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#float">float</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Radius at the left edge of the simulation domain (at minimum 'x')</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
<p><span class="doc-section-title">Returns:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title="numpy.typing.NDArray" href="#numpy.typing.NDArray">NDArray</a>[<a class="autorefs autorefs-internal" title="numpy.complex128" href="#numpy.complex128">complex128</a>]</code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>NDArray containing the calculated linear (1/distance) wavenumbers</p>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="doc doc-object doc-function">
|
|
|
|
|
|
<h3 id="api-waveguides-meanas.fdfd.waveguide_cyl.exy2h" class="doc doc-heading">
|
|
<code class="doc-symbol doc-symbol-heading doc-symbol-function"></code> <span class="doc doc-object-name doc-function-name">exy2h</span>
|
|
|
|
|
|
<a href="#api-waveguides-meanas.fdfd.waveguide_cyl.exy2h" class="headerlink" title="Permanent link">¶</a></h3>
|
|
<div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#api-waveguides-__codelineno-0-1"></a><span class="nf">exy2h</span><span class="p">(</span>
|
|
<a id="__codelineno-0-2" name="__codelineno-0-2" href="#api-waveguides-__codelineno-0-2"></a> <span class="n">angular_wavenumber</span><span class="p">:</span> <span class="nb">complex</span><span class="p">,</span>
|
|
<a id="__codelineno-0-3" name="__codelineno-0-3" href="#api-waveguides-__codelineno-0-3"></a> <span class="n">omega</span><span class="p">:</span> <span class="nb">float</span><span class="p">,</span>
|
|
<a id="__codelineno-0-4" name="__codelineno-0-4" href="#api-waveguides-__codelineno-0-4"></a> <span class="n">dxes</span><span class="p">:</span> <span class="n">dx_lists2_t</span><span class="p">,</span>
|
|
<a id="__codelineno-0-5" name="__codelineno-0-5" href="#api-waveguides-__codelineno-0-5"></a> <span class="n">rmin</span><span class="p">:</span> <span class="nb">float</span><span class="p">,</span>
|
|
<a id="__codelineno-0-6" name="__codelineno-0-6" href="#api-waveguides-__codelineno-0-6"></a> <span class="n">epsilon</span><span class="p">:</span> <span class="n">vfdslice</span><span class="p">,</span>
|
|
<a id="__codelineno-0-7" name="__codelineno-0-7" href="#api-waveguides-__codelineno-0-7"></a> <span class="n">mu</span><span class="p">:</span> <span class="n">vfdslice</span> <span class="o">|</span> <span class="kc">None</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
|
|
<a id="__codelineno-0-8" name="__codelineno-0-8" href="#api-waveguides-__codelineno-0-8"></a><span class="p">)</span> <span class="o">-></span> <span class="n">sparse</span><span class="o">.</span><span class="n">sparray</span>
|
|
</code></pre></div>
|
|
|
|
<div class="doc doc-contents ">
|
|
|
|
<p>Operator which transforms the vector <code>e_xy</code> containing the vectorized E_r and E_y fields,
|
|
into a vectorized H containing all three H components</p>
|
|
|
|
|
|
<p><span class="doc-section-title">Parameters:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
<th>Default</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>angular_wavenumber</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#complex">complex</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Wavenumber assuming fields have theta-dependence of
|
|
<code>exp(-i * angular_wavenumber * theta)</code>. It should satisfy
|
|
<code>operator_e() @ e_xy == (angular_wavenumber / rmin) ** 2 * e_xy</code></p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>omega</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#float">float</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>The angular frequency of the system</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>dxes</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" dx_lists2_t
|
|
|
|
|
|
|
|
module-attribute
|
|
(meanas.fdmath.dx_lists2_t)" href="#api-fdmath-meanas.fdmath.types.dx_lists2_t">dx_lists2_t</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Grid parameters <code>[dx_e, dx_h]</code> as described in <code>meanas.fdmath.types</code> (2D)</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>rmin</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#float">float</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Radius at the left edge of the simulation domain (at minimum 'x')</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>epsilon</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" vfdslice (meanas.fdmath.vfdslice)" href="#api-fdmath-meanas.fdmath.types.vfdslice">vfdslice</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Vectorized dielectric constant grid</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>mu</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" vfdslice (meanas.fdmath.vfdslice)" href="#api-fdmath-meanas.fdmath.types.vfdslice">vfdslice</a> | None</code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Vectorized magnetic permeability grid (default 1 everywhere)</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<code>None</code>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
<p><span class="doc-section-title">Returns:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title="scipy.sparse.sparray" href="#scipy.sparse.sparray">sparray</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Sparse matrix representing the operator.</p>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="doc doc-object doc-function">
|
|
|
|
|
|
<h3 id="api-waveguides-meanas.fdfd.waveguide_cyl.exy2e" class="doc doc-heading">
|
|
<code class="doc-symbol doc-symbol-heading doc-symbol-function"></code> <span class="doc doc-object-name doc-function-name">exy2e</span>
|
|
|
|
|
|
<a href="#api-waveguides-meanas.fdfd.waveguide_cyl.exy2e" class="headerlink" title="Permanent link">¶</a></h3>
|
|
<div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#api-waveguides-__codelineno-0-1"></a><span class="nf">exy2e</span><span class="p">(</span>
|
|
<a id="__codelineno-0-2" name="__codelineno-0-2" href="#api-waveguides-__codelineno-0-2"></a> <span class="n">angular_wavenumber</span><span class="p">:</span> <span class="nb">complex</span><span class="p">,</span>
|
|
<a id="__codelineno-0-3" name="__codelineno-0-3" href="#api-waveguides-__codelineno-0-3"></a> <span class="n">omega</span><span class="p">:</span> <span class="nb">float</span><span class="p">,</span>
|
|
<a id="__codelineno-0-4" name="__codelineno-0-4" href="#api-waveguides-__codelineno-0-4"></a> <span class="n">dxes</span><span class="p">:</span> <span class="n">dx_lists2_t</span><span class="p">,</span>
|
|
<a id="__codelineno-0-5" name="__codelineno-0-5" href="#api-waveguides-__codelineno-0-5"></a> <span class="n">rmin</span><span class="p">:</span> <span class="nb">float</span><span class="p">,</span>
|
|
<a id="__codelineno-0-6" name="__codelineno-0-6" href="#api-waveguides-__codelineno-0-6"></a> <span class="n">epsilon</span><span class="p">:</span> <span class="n">vfdslice</span><span class="p">,</span>
|
|
<a id="__codelineno-0-7" name="__codelineno-0-7" href="#api-waveguides-__codelineno-0-7"></a><span class="p">)</span> <span class="o">-></span> <span class="n">sparse</span><span class="o">.</span><span class="n">sparray</span>
|
|
</code></pre></div>
|
|
|
|
<div class="doc doc-contents ">
|
|
|
|
<p>Operator which transforms the vector <code>e_xy</code> containing the vectorized E_r and E_y fields,
|
|
into a vectorized E containing all three E components</p>
|
|
<p>Unlike the straight waveguide case, the H_z components do not cancel and must be calculated
|
|
from E_r and E_y in order to then calculate E_z.</p>
|
|
|
|
|
|
<p><span class="doc-section-title">Parameters:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
<th>Default</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>angular_wavenumber</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#complex">complex</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Wavenumber assuming fields have theta-dependence of
|
|
<code>exp(-i * angular_wavenumber * theta)</code>. It should satisfy
|
|
<code>operator_e() @ e_xy == (angular_wavenumber / rmin) ** 2 * e_xy</code></p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>omega</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#float">float</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>The angular frequency of the system</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>dxes</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" dx_lists2_t
|
|
|
|
|
|
|
|
module-attribute
|
|
(meanas.fdmath.dx_lists2_t)" href="#api-fdmath-meanas.fdmath.types.dx_lists2_t">dx_lists2_t</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Grid parameters <code>[dx_e, dx_h]</code> as described in <code>meanas.fdmath.types</code> (2D)</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>rmin</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#float">float</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Radius at the left edge of the simulation domain (at minimum 'x')</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>epsilon</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" vfdslice (meanas.fdmath.vfdslice)" href="#api-fdmath-meanas.fdmath.types.vfdslice">vfdslice</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Vectorized dielectric constant grid</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
<p><span class="doc-section-title">Returns:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title="scipy.sparse.sparray" href="#scipy.sparse.sparray">sparray</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Sparse matrix representing the operator.</p>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="doc doc-object doc-function">
|
|
|
|
|
|
<h3 id="api-waveguides-meanas.fdfd.waveguide_cyl.e2h" class="doc doc-heading">
|
|
<code class="doc-symbol doc-symbol-heading doc-symbol-function"></code> <span class="doc doc-object-name doc-function-name">e2h</span>
|
|
|
|
|
|
<a href="#api-waveguides-meanas.fdfd.waveguide_cyl.e2h" class="headerlink" title="Permanent link">¶</a></h3>
|
|
<div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#api-waveguides-__codelineno-0-1"></a><span class="nf">e2h</span><span class="p">(</span>
|
|
<a id="__codelineno-0-2" name="__codelineno-0-2" href="#api-waveguides-__codelineno-0-2"></a> <span class="n">angular_wavenumber</span><span class="p">:</span> <span class="nb">complex</span><span class="p">,</span>
|
|
<a id="__codelineno-0-3" name="__codelineno-0-3" href="#api-waveguides-__codelineno-0-3"></a> <span class="n">omega</span><span class="p">:</span> <span class="nb">float</span><span class="p">,</span>
|
|
<a id="__codelineno-0-4" name="__codelineno-0-4" href="#api-waveguides-__codelineno-0-4"></a> <span class="n">dxes</span><span class="p">:</span> <span class="n">dx_lists2_t</span><span class="p">,</span>
|
|
<a id="__codelineno-0-5" name="__codelineno-0-5" href="#api-waveguides-__codelineno-0-5"></a> <span class="n">rmin</span><span class="p">:</span> <span class="nb">float</span><span class="p">,</span>
|
|
<a id="__codelineno-0-6" name="__codelineno-0-6" href="#api-waveguides-__codelineno-0-6"></a> <span class="n">mu</span><span class="p">:</span> <span class="n">vfdslice</span> <span class="o">|</span> <span class="kc">None</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
|
|
<a id="__codelineno-0-7" name="__codelineno-0-7" href="#api-waveguides-__codelineno-0-7"></a><span class="p">)</span> <span class="o">-></span> <span class="n">sparse</span><span class="o">.</span><span class="n">sparray</span>
|
|
</code></pre></div>
|
|
|
|
<div class="doc doc-contents ">
|
|
|
|
<p>Returns an operator which, when applied to a vectorized E eigenfield, produces
|
|
the vectorized H eigenfield.</p>
|
|
<p>This operator is created directly from the initial coordinate-transformed equations:
|
|
$$
|
|
\begin{aligned}
|
|
-\imath \omega \mu_{rr} H_r &= \tilde{\partial}<em yy="yy">y E_z + \imath \beta T_a^{-1} E_y, \
|
|
-\imath \omega \mu</em> E_r
|
|
- T_b^{-1} \tilde{\partial}} H_y &= -\imath \beta T_b^{-1<em zz="zz">r (T_a E_z), \
|
|
-\imath \omega \mu</em>_y E_r,
|
|
\end{aligned}
|
|
$$} H_z &= \tilde{\partial}_r E_y - \tilde{\partial</p>
|
|
|
|
|
|
<p><span class="doc-section-title">Parameters:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
<th>Default</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>angular_wavenumber</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#complex">complex</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Wavenumber assuming fields have theta-dependence of
|
|
<code>exp(-i * angular_wavenumber * theta)</code>. It should satisfy
|
|
<code>operator_e() @ e_xy == (angular_wavenumber / rmin) ** 2 * e_xy</code></p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>omega</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#float">float</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>The angular frequency of the system</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>dxes</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" dx_lists2_t
|
|
|
|
|
|
|
|
module-attribute
|
|
(meanas.fdmath.dx_lists2_t)" href="#api-fdmath-meanas.fdmath.types.dx_lists2_t">dx_lists2_t</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Grid parameters <code>[dx_e, dx_h]</code> as described in <code>meanas.fdmath.types</code> (2D)</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>rmin</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#float">float</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Radius at the left edge of the simulation domain (at minimum 'x')</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>mu</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" vfdslice (meanas.fdmath.vfdslice)" href="#api-fdmath-meanas.fdmath.types.vfdslice">vfdslice</a> | None</code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Vectorized magnetic permeability grid (default 1 everywhere)</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<code>None</code>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
<p><span class="doc-section-title">Returns:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title="scipy.sparse.sparray" href="#scipy.sparse.sparray">sparray</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Sparse matrix representation of the operator.</p>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="doc doc-object doc-function">
|
|
|
|
|
|
<h3 id="api-waveguides-meanas.fdfd.waveguide_cyl.dxes2T" class="doc doc-heading">
|
|
<code class="doc-symbol doc-symbol-heading doc-symbol-function"></code> <span class="doc doc-object-name doc-function-name">dxes2T</span>
|
|
|
|
|
|
<a href="#api-waveguides-meanas.fdfd.waveguide_cyl.dxes2T" class="headerlink" title="Permanent link">¶</a></h3>
|
|
<div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#api-waveguides-__codelineno-0-1"></a><span class="nf">dxes2T</span><span class="p">(</span>
|
|
<a id="__codelineno-0-2" name="__codelineno-0-2" href="#api-waveguides-__codelineno-0-2"></a> <span class="n">dxes</span><span class="p">:</span> <span class="n">dx_lists2_t</span><span class="p">,</span> <span class="n">rmin</span><span class="p">:</span> <span class="nb">float</span>
|
|
<a id="__codelineno-0-3" name="__codelineno-0-3" href="#api-waveguides-__codelineno-0-3"></a><span class="p">)</span> <span class="o">-></span> <span class="nb">tuple</span><span class="p">[</span><span class="n">NDArray</span><span class="p">[</span><span class="n">numpy</span><span class="o">.</span><span class="n">float64</span><span class="p">],</span> <span class="n">NDArray</span><span class="p">[</span><span class="n">numpy</span><span class="o">.</span><span class="n">float64</span><span class="p">]]</span>
|
|
</code></pre></div>
|
|
|
|
<div class="doc doc-contents ">
|
|
|
|
<p>Construct the cylindrical metric matrices <span class="arithmatex">\(T_a\)</span> and <span class="arithmatex">\(T_b\)</span>.</p>
|
|
<p><code>T_a</code> is sampled on the E-grid radial locations, while <code>T_b</code> is sampled on
|
|
the staggered H-grid radial locations. These are the diagonal matrices that
|
|
convert the straight-waveguide algebra into its cylindrical counterpart.</p>
|
|
|
|
|
|
<p><span class="doc-section-title">Parameters:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
<th>Default</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>dxes</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" dx_lists2_t
|
|
|
|
|
|
|
|
module-attribute
|
|
(meanas.fdmath.dx_lists2_t)" href="#api-fdmath-meanas.fdmath.types.dx_lists2_t">dx_lists2_t</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Grid parameters <code>[dx_e, dx_h]</code> as described in <code>meanas.fdmath.types</code> (2D)</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>rmin</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#float">float</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Radius at the left edge of the simulation domain (at minimum 'x')</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
<p><span class="doc-section-title">Returns:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#tuple">tuple</a>[<a class="autorefs autorefs-internal" title="numpy.typing.NDArray" href="#numpy.typing.NDArray">NDArray</a>[<a class="autorefs autorefs-internal" title="numpy.float64" href="#numpy.float64">float64</a>], <a class="autorefs autorefs-internal" title="numpy.typing.NDArray" href="#numpy.typing.NDArray">NDArray</a>[<a class="autorefs autorefs-internal" title="numpy.float64" href="#numpy.float64">float64</a>]]</code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Sparse diagonal matrices <code>(T_a, T_b)</code>.</p>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="doc doc-object doc-function">
|
|
|
|
|
|
<h3 id="api-waveguides-meanas.fdfd.waveguide_cyl.normalized_fields_e" class="doc doc-heading">
|
|
<code class="doc-symbol doc-symbol-heading doc-symbol-function"></code> <span class="doc doc-object-name doc-function-name">normalized_fields_e</span>
|
|
|
|
|
|
<a href="#api-waveguides-meanas.fdfd.waveguide_cyl.normalized_fields_e" class="headerlink" title="Permanent link">¶</a></h3>
|
|
<div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#api-waveguides-__codelineno-0-1"></a><span class="nf">normalized_fields_e</span><span class="p">(</span>
|
|
<a id="__codelineno-0-2" name="__codelineno-0-2" href="#api-waveguides-__codelineno-0-2"></a> <span class="n">e_xy</span><span class="p">:</span> <span class="n">vcfdfield2</span><span class="p">,</span>
|
|
<a id="__codelineno-0-3" name="__codelineno-0-3" href="#api-waveguides-__codelineno-0-3"></a> <span class="n">angular_wavenumber</span><span class="p">:</span> <span class="nb">complex</span><span class="p">,</span>
|
|
<a id="__codelineno-0-4" name="__codelineno-0-4" href="#api-waveguides-__codelineno-0-4"></a> <span class="n">omega</span><span class="p">:</span> <span class="nb">float</span><span class="p">,</span>
|
|
<a id="__codelineno-0-5" name="__codelineno-0-5" href="#api-waveguides-__codelineno-0-5"></a> <span class="n">dxes</span><span class="p">:</span> <span class="n">dx_lists2_t</span><span class="p">,</span>
|
|
<a id="__codelineno-0-6" name="__codelineno-0-6" href="#api-waveguides-__codelineno-0-6"></a> <span class="n">rmin</span><span class="p">:</span> <span class="nb">float</span><span class="p">,</span>
|
|
<a id="__codelineno-0-7" name="__codelineno-0-7" href="#api-waveguides-__codelineno-0-7"></a> <span class="n">epsilon</span><span class="p">:</span> <span class="n">vfdslice</span><span class="p">,</span>
|
|
<a id="__codelineno-0-8" name="__codelineno-0-8" href="#api-waveguides-__codelineno-0-8"></a> <span class="n">mu</span><span class="p">:</span> <span class="n">vfdslice</span> <span class="o">|</span> <span class="kc">None</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
|
|
<a id="__codelineno-0-9" name="__codelineno-0-9" href="#api-waveguides-__codelineno-0-9"></a> <span class="n">prop_phase</span><span class="p">:</span> <span class="nb">float</span> <span class="o">=</span> <span class="mi">0</span><span class="p">,</span>
|
|
<a id="__codelineno-0-10" name="__codelineno-0-10" href="#api-waveguides-__codelineno-0-10"></a><span class="p">)</span> <span class="o">-></span> <span class="nb">tuple</span><span class="p">[</span><span class="n">vcfdslice_t</span><span class="p">,</span> <span class="n">vcfdslice_t</span><span class="p">]</span>
|
|
</code></pre></div>
|
|
|
|
<div class="doc doc-contents ">
|
|
|
|
<p>Given a vector <code>e_xy</code> containing the vectorized E_r and E_y fields,
|
|
returns normalized, vectorized E and H fields for the system.</p>
|
|
|
|
|
|
<p><span class="doc-section-title">Parameters:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
<th>Default</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>e_xy</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" vcfdfield2 (meanas.fdmath.vcfdfield2)" href="#api-fdmath-meanas.fdmath.types.vcfdfield2">vcfdfield2</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Vector containing E_r and E_y fields</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>angular_wavenumber</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#complex">complex</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Wavenumber assuming fields have theta-dependence of
|
|
<code>exp(-i * angular_wavenumber * theta)</code>. It should satisfy
|
|
<code>operator_e() @ e_xy == (angular_wavenumber / rmin) ** 2 * e_xy</code></p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>omega</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#float">float</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>The angular frequency of the system</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>dxes</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" dx_lists2_t
|
|
|
|
|
|
|
|
module-attribute
|
|
(meanas.fdmath.dx_lists2_t)" href="#api-fdmath-meanas.fdmath.types.dx_lists2_t">dx_lists2_t</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Grid parameters <code>[dx_e, dx_h]</code> as described in <code>meanas.fdmath.types</code> (2D)</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>rmin</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#float">float</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Radius at the left edge of the simulation domain (at minimum 'x')</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>epsilon</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" vfdslice (meanas.fdmath.vfdslice)" href="#api-fdmath-meanas.fdmath.types.vfdslice">vfdslice</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Vectorized dielectric constant grid</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>mu</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" vfdslice (meanas.fdmath.vfdslice)" href="#api-fdmath-meanas.fdmath.types.vfdslice">vfdslice</a> | None</code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Vectorized magnetic permeability grid (default 1 everywhere)</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<code>None</code>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>prop_phase</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#float">float</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Phase shift <code>(dz * corrected_wavenumber)</code> over 1 cell in propagation direction.
|
|
Default 0 (continuous propagation direction, i.e. dz->0).</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<code>0</code>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
<p><span class="doc-section-title">Returns:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title="meanas.fdmath.vcfdslice_t" href="#meanas.fdmath.vcfdslice_t">vcfdslice_t</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p><code>(e, h)</code>, where each field is vectorized, normalized,</p>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title="meanas.fdmath.vcfdslice_t" href="#meanas.fdmath.vcfdslice_t">vcfdslice_t</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>and contains all three vector components.</p>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
<details class="notes" open>
|
|
<summary>Notes</summary>
|
|
<p>The normalization step is delegated to <code>_normalized_fields(...)</code>, which
|
|
enforces unit forward power under the discrete inner product</p>
|
|
<div class="arithmatex">\[
|
|
\frac{1}{2}\int (E_r H_y^* - E_y H_r^*) \, dr \, dy.
|
|
\]</div>
|
|
<p>The angular wavenumber <code>m</code> is first converted into the full three-component
|
|
fields, then the overall complex phase and sign are fixed so the result is
|
|
reproducible for symmetric modes.</p>
|
|
</details>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div></section><section class="print-page" id="api-fdtd" heading-number="2.6"><h1 id="api-fdtd-fdtd">fdtd<a class="headerlink" href="#api-fdtd-fdtd" title="Permanent link">¶</a></h1>
|
|
|
|
|
|
<div class="doc doc-object doc-module">
|
|
|
|
|
|
|
|
<h2 id="api-fdtd-meanas.fdtd" class="doc doc-heading">
|
|
<code class="doc-symbol doc-symbol-heading doc-symbol-module"></code> <span class="doc doc-object-name doc-module-name">meanas.fdtd</span>
|
|
|
|
|
|
<a href="#api-fdtd-meanas.fdtd" class="headerlink" title="Permanent link">¶</a></h2>
|
|
|
|
<div class="doc doc-contents first">
|
|
|
|
<p>Utilities for running finite-difference time-domain (FDTD) simulations</p>
|
|
<p>See the discussion of <code>Maxwell's Equations</code> in <code>meanas.fdmath</code> for basic
|
|
mathematical background.</p>
|
|
<h3 id="api-fdtd-meanas.fdtd--timestep">Timestep<a class="headerlink" href="#api-fdtd-meanas.fdtd--timestep" title="Permanent link">¶</a></h3>
|
|
<p>From the discussion of "Plane waves and the Dispersion relation" in <code>meanas.fdmath</code>,
|
|
we have</p>
|
|
<div class="arithmatex">\[ c^2 \Delta_t^2 = \frac{\Delta_t^2}{\mu \epsilon} < 1/(\frac{1}{\Delta_x^2} + \frac{1}{\Delta_y^2} + \frac{1}{\Delta_z^2}) \]</div>
|
|
<p>or, if <span class="arithmatex">\(\Delta_x = \Delta_y = \Delta_z\)</span>, then <span class="arithmatex">\(c \Delta_t < \frac{\Delta_x}{\sqrt{3}}\)</span>.</p>
|
|
<p>Based on this, we can set</p>
|
|
<div class="highlight"><pre><span></span><code>dt = sqrt(mu.min() * epsilon.min()) / sqrt(1/dx_min**2 + 1/dy_min**2 + 1/dz_min**2)
|
|
</code></pre></div>
|
|
<p>The <code>dx_min</code>, <code>dy_min</code>, <code>dz_min</code> should be the minimum value across both the base and derived grids.</p>
|
|
<h3 id="api-fdtd-meanas.fdtd--poynting-vector-and-energy-conservation">Poynting Vector and Energy Conservation<a class="headerlink" href="#api-fdtd-meanas.fdtd--poynting-vector-and-energy-conservation" title="Permanent link">¶</a></h3>
|
|
<p>Let</p>
|
|
<div class="arithmatex">\[ \begin{aligned}
|
|
\tilde{S}_{l, l', \vec{r}} &=& &\tilde{E}_{l, \vec{r}} \otimes \hat{H}_{l', \vec{r} + \frac{1}{2}} \\
|
|
&=& &\vec{x} (\tilde{E}^y_{l,m+1,n,p} \hat{H}^z_{l',\vec{r} + \frac{1}{2}} - \tilde{E}^z_{l,m+1,n,p} \hat{H}^y_{l', \vec{r} + \frac{1}{2}}) \\
|
|
& &+ &\vec{y} (\tilde{E}^z_{l,m,n+1,p} \hat{H}^x_{l',\vec{r} + \frac{1}{2}} - \tilde{E}^x_{l,m,n+1,p} \hat{H}^z_{l', \vec{r} + \frac{1}{2}}) \\
|
|
& &+ &\vec{z} (\tilde{E}^x_{l,m,n,p+1} \hat{H}^y_{l',\vec{r} + \frac{1}{2}} - \tilde{E}^y_{l,m,n,p+1} \hat{H}^z_{l', \vec{r} + \frac{1}{2}})
|
|
\end{aligned}
|
|
\]</div>
|
|
<p>where <span class="arithmatex">\(\vec{r} = (m, n, p)\)</span> and <span class="arithmatex">\(\otimes\)</span> is a modified cross product
|
|
in which the <span class="arithmatex">\(\tilde{E}\)</span> terms are shifted as indicated.</p>
|
|
<p>By taking the divergence and rearranging terms, we can show that</p>
|
|
<div class="arithmatex">\[
|
|
\begin{aligned}
|
|
\hat{\nabla} \cdot \tilde{S}_{l, l', \vec{r}}
|
|
&= \hat{\nabla} \cdot (\tilde{E}_{l, \vec{r}} \otimes \hat{H}_{l', \vec{r} + \frac{1}{2}}) \\
|
|
&= \hat{H}_{l', \vec{r} + \frac{1}{2}} \cdot \tilde{\nabla} \times \tilde{E}_{l, \vec{r}} -
|
|
\tilde{E}_{l, \vec{r}} \cdot \hat{\nabla} \times \hat{H}_{l', \vec{r} + \frac{1}{2}} \\
|
|
&= \hat{H}_{l', \vec{r} + \frac{1}{2}} \cdot
|
|
(-\tilde{\partial}_t \mu_{\vec{r} + \frac{1}{2}} \hat{H}_{l - \frac{1}{2}, \vec{r} + \frac{1}{2}} -
|
|
\hat{M}_{l, \vec{r} + \frac{1}{2}}) -
|
|
\tilde{E}_{l, \vec{r}} \cdot (\hat{\partial}_t \tilde{\epsilon}_{\vec{r}} \tilde{E}_{l'+\frac{1}{2}, \vec{r}} +
|
|
\tilde{J}_{l', \vec{r}}) \\
|
|
&= \hat{H}_{l'} \cdot (-\mu / \Delta_t)(\hat{H}_{l + \frac{1}{2}} - \hat{H}_{l - \frac{1}{2}}) -
|
|
\tilde{E}_l \cdot (\epsilon / \Delta_t )(\tilde{E}_{l'+\frac{1}{2}} - \tilde{E}_{l'-\frac{1}{2}})
|
|
- \hat{H}_{l'} \cdot \hat{M}_{l} - \tilde{E}_l \cdot \tilde{J}_{l'} \\
|
|
\end{aligned}
|
|
\]</div>
|
|
<p>where in the last line the spatial subscripts have been dropped to emphasize
|
|
the time subscripts <span class="arithmatex">\(l, l'\)</span>, i.e.</p>
|
|
<div class="arithmatex">\[
|
|
\begin{aligned}
|
|
\tilde{E}_l &= \tilde{E}_{l, \vec{r}} \\
|
|
\hat{H}_l &= \tilde{H}_{l, \vec{r} + \frac{1}{2}} \\
|
|
\tilde{\epsilon} &= \tilde{\epsilon}_{\vec{r}} \\
|
|
\end{aligned}
|
|
\]</div>
|
|
<p>etc.
|
|
For <span class="arithmatex">\(l' = l + \frac{1}{2}\)</span> we get</p>
|
|
<div class="arithmatex">\[
|
|
\begin{aligned}
|
|
\hat{\nabla} \cdot \tilde{S}_{l, l + \frac{1}{2}}
|
|
&= \hat{H}_{l + \frac{1}{2}} \cdot
|
|
(-\mu / \Delta_t)(\hat{H}_{l + \frac{1}{2}} - \hat{H}_{l - \frac{1}{2}}) -
|
|
\tilde{E}_l \cdot (\epsilon / \Delta_t)(\tilde{E}_{l+1} - \tilde{E}_l)
|
|
- \hat{H}_{l'} \cdot \hat{M}_l - \tilde{E}_l \cdot \tilde{J}_{l + \frac{1}{2}} \\
|
|
&= (-\mu / \Delta_t)(\hat{H}^2_{l + \frac{1}{2}} - \hat{H}_{l + \frac{1}{2}} \cdot \hat{H}_{l - \frac{1}{2}}) -
|
|
(\epsilon / \Delta_t)(\tilde{E}_{l+1} \cdot \tilde{E}_l - \tilde{E}^2_l)
|
|
- \hat{H}_{l'} \cdot \hat{M}_l - \tilde{E}_l \cdot \tilde{J}_{l + \frac{1}{2}} \\
|
|
&= -(\mu \hat{H}^2_{l + \frac{1}{2}}
|
|
+\epsilon \tilde{E}_{l+1} \cdot \tilde{E}_l) / \Delta_t \\
|
|
+(\mu \hat{H}_{l + \frac{1}{2}} \cdot \hat{H}_{l - \frac{1}{2}}
|
|
+\epsilon \tilde{E}^2_l) / \Delta_t \\
|
|
- \hat{H}_{l+\frac{1}{2}} \cdot \hat{M}_l \\
|
|
- \tilde{E}_l \cdot \tilde{J}_{l+\frac{1}{2}} \\
|
|
\end{aligned}
|
|
\]</div>
|
|
<p>and for <span class="arithmatex">\(l' = l - \frac{1}{2}\)</span>,</p>
|
|
<div class="arithmatex">\[
|
|
\begin{aligned}
|
|
\hat{\nabla} \cdot \tilde{S}_{l, l - \frac{1}{2}}
|
|
&= (\mu \hat{H}^2_{l - \frac{1}{2}}
|
|
+\epsilon \tilde{E}_{l-1} \cdot \tilde{E}_l) / \Delta_t \\
|
|
-(\mu \hat{H}_{l + \frac{1}{2}} \cdot \hat{H}_{l - \frac{1}{2}}
|
|
+\epsilon \tilde{E}^2_l) / \Delta_t \\
|
|
- \hat{H}_{l-\frac{1}{2}} \cdot \hat{M}_l \\
|
|
- \tilde{E}_l \cdot \tilde{J}_{l-\frac{1}{2}} \\
|
|
\end{aligned}
|
|
\]</div>
|
|
<p>These two results form the discrete time-domain analogue to Poynting's theorem.
|
|
They hint at the expressions for the energy, which can be calculated at the same
|
|
time-index as either the E or H field:</p>
|
|
<div class="arithmatex">\[
|
|
\begin{aligned}
|
|
U_l &= \epsilon \tilde{E}^2_l + \mu \hat{H}_{l + \frac{1}{2}} \cdot \hat{H}_{l - \frac{1}{2}} \\
|
|
U_{l + \frac{1}{2}} &= \epsilon \tilde{E}_l \cdot \tilde{E}_{l + 1} + \mu \hat{H}^2_{l + \frac{1}{2}} \\
|
|
\end{aligned}
|
|
\]</div>
|
|
<p>Rewriting the Poynting theorem in terms of the energy expressions,</p>
|
|
<div class="arithmatex">\[
|
|
\begin{aligned}
|
|
(U_{l+\frac{1}{2}} - U_l) / \Delta_t
|
|
&= -\hat{\nabla} \cdot \tilde{S}_{l, l + \frac{1}{2}} \\
|
|
- \hat{H}_{l+\frac{1}{2}} \cdot \hat{M}_l \\
|
|
- \tilde{E}_l \cdot \tilde{J}_{l+\frac{1}{2}} \\
|
|
(U_l - U_{l-\frac{1}{2}}) / \Delta_t
|
|
&= -\hat{\nabla} \cdot \tilde{S}_{l, l - \frac{1}{2}} \\
|
|
- \hat{H}_{l-\frac{1}{2}} \cdot \hat{M}_l \\
|
|
- \tilde{E}_l \cdot \tilde{J}_{l-\frac{1}{2}} \\
|
|
\end{aligned}
|
|
\]</div>
|
|
<p>This result is exact and should practically hold to within numerical precision. No time-
|
|
or spatial-averaging is necessary.</p>
|
|
<p>Note that each value of <span class="arithmatex">\(J\)</span> contributes to the energy twice (i.e. once per field update)
|
|
despite only causing the value of <span class="arithmatex">\(E\)</span> to change once (same for <span class="arithmatex">\(M\)</span> and <span class="arithmatex">\(H\)</span>).</p>
|
|
<h3 id="api-fdtd-meanas.fdtd--sources">Sources<a class="headerlink" href="#api-fdtd-meanas.fdtd--sources" title="Permanent link">¶</a></h3>
|
|
<p>It is often useful to excite the simulation with an arbitrary broadband pulse and then
|
|
extract the frequency-domain response by performing an on-the-fly Fourier transform
|
|
of the time-domain fields.</p>
|
|
<p><code>accumulate_phasor</code> in <code>meanas.fdtd.phasor</code> performs the phase accumulation for one
|
|
or more target frequencies, while leaving source normalization and simulation-loop
|
|
policy to the caller. Convenience wrappers <code>accumulate_phasor_e</code>,
|
|
<code>accumulate_phasor_h</code>, and <code>accumulate_phasor_j</code> apply the usual Yee time offsets.
|
|
The helpers accumulate</p>
|
|
<div class="arithmatex">\[ \Delta_t \sum_l w_l e^{-i \omega t_l} f_l \]</div>
|
|
<p>with caller-provided sample times and weights. In this codebase the matching
|
|
electric-current convention is typically <code>E -= dt * J / epsilon</code> in FDTD and
|
|
<code>-i \omega J</code> on the right-hand side of the FDFD wave equation.</p>
|
|
<p>The Ricker wavelet (normalized second derivative of a Gaussian) is commonly used for the pulse
|
|
shape. It can be written</p>
|
|
<div class="arithmatex">\[ f_r(t) = (1 - \frac{1}{2} (\omega (t - \tau))^2) e^{-(\frac{\omega (t - \tau)}{2})^2} \]</div>
|
|
<p>with <span class="arithmatex">\(\tau > \frac{2 * \pi}{\omega}\)</span> as a minimum delay to avoid a discontinuity at
|
|
t=0 (assuming the source is off for t<0 this gives <span class="arithmatex">\(\sim 10^{-3}\)</span> error at t=0).</p>
|
|
<h3 id="api-fdtd-meanas.fdtd--boundary-conditions">Boundary conditions<a class="headerlink" href="#api-fdtd-meanas.fdtd--boundary-conditions" title="Permanent link">¶</a></h3>
|
|
<p><code>meanas.fdtd</code> exposes two boundary-related building blocks:</p>
|
|
<ul>
|
|
<li><code>conducting_boundary(...)</code> for simple perfect-electric-conductor style field
|
|
clamping at one face of the domain.</li>
|
|
<li><code>cpml_params(...)</code> and <code>updates_with_cpml(...)</code> for convolutional perfectly
|
|
matched layers (CPMLs) attached to one or more faces of the Yee grid.</li>
|
|
</ul>
|
|
<p><code>updates_with_cpml(...)</code> accepts a three-by-two table of CPML parameter blocks:</p>
|
|
<div class="highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#api-fdtd-__codelineno-0-1"></a>cpml_params[axis][polarity_index]
|
|
</code></pre></div>
|
|
<p>where <code>axis</code> is <code>0</code>, <code>1</code>, or <code>2</code> and <code>polarity_index</code> corresponds to <code>(-1, +1)</code>.
|
|
Passing <code>None</code> for one entry disables CPML on that face while leaving the other
|
|
directions unchanged. This is how mixed boundary setups such as "absorbing in x,
|
|
periodic in y/z" are expressed.</p>
|
|
<p>When comparing an FDTD run against an FDFD solve, use the same stretched
|
|
coordinate system in both places:</p>
|
|
<ol>
|
|
<li>Build the FDTD update with the desired CPML parameters.</li>
|
|
<li>Stretch the FDFD <code>dxes</code> with the matching SCPML transform.</li>
|
|
<li>Compare the extracted phasor against the FDFD field or residual on those
|
|
stretched <code>dxes</code>.</li>
|
|
</ol>
|
|
<p>The electric-current sign convention used throughout the examples and tests is</p>
|
|
<div class="arithmatex">\[
|
|
E \leftarrow E - \Delta_t J / \epsilon
|
|
\]</div>
|
|
<p>which matches the FDFD right-hand side</p>
|
|
<div class="arithmatex">\[
|
|
-i \omega J.
|
|
\]</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="doc doc-children">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div><h2 id="core-update-and-analysis-helpers">Core update and analysis helpers<a class="headerlink" href="#api-fdtd-core-update-and-analysis-helpers" title="Permanent link">¶</a></h2>
|
|
|
|
|
|
<div class="doc doc-object doc-module">
|
|
|
|
|
|
|
|
<h2 id="api-fdtd-meanas.fdtd.base" class="doc doc-heading">
|
|
<code class="doc-symbol doc-symbol-heading doc-symbol-module"></code> <span class="doc doc-object-name doc-module-name">meanas.fdtd.base</span>
|
|
|
|
|
|
<a href="#api-fdtd-meanas.fdtd.base" class="headerlink" title="Permanent link">¶</a></h2>
|
|
|
|
<div class="doc doc-contents first">
|
|
|
|
<p>Basic FDTD field updates</p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="doc doc-children">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="doc doc-object doc-function">
|
|
|
|
|
|
<h3 id="api-fdtd-meanas.fdtd.base.maxwell_e" class="doc doc-heading">
|
|
<code class="doc-symbol doc-symbol-heading doc-symbol-function"></code> <span class="doc doc-object-name doc-function-name">maxwell_e</span>
|
|
|
|
|
|
<a href="#api-fdtd-meanas.fdtd.base.maxwell_e" class="headerlink" title="Permanent link">¶</a></h3>
|
|
<div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#api-fdtd-__codelineno-0-1"></a><span class="nf">maxwell_e</span><span class="p">(</span>
|
|
<a id="__codelineno-0-2" name="__codelineno-0-2" href="#api-fdtd-__codelineno-0-2"></a> <span class="n">dt</span><span class="p">:</span> <span class="nb">float</span><span class="p">,</span> <span class="n">dxes</span><span class="p">:</span> <span class="n">dx_lists_t</span> <span class="o">|</span> <span class="kc">None</span> <span class="o">=</span> <span class="kc">None</span>
|
|
<a id="__codelineno-0-3" name="__codelineno-0-3" href="#api-fdtd-__codelineno-0-3"></a><span class="p">)</span> <span class="o">-></span> <span class="n">fdfield_updater_t</span>
|
|
</code></pre></div>
|
|
|
|
<div class="doc doc-contents ">
|
|
|
|
<p>Build a function which performs a portion the time-domain E-field update,</p>
|
|
<div class="highlight"><pre><span></span><code>E += curl_back(H[t]) / epsilon
|
|
</code></pre></div>
|
|
<p>The full update should be</p>
|
|
<div class="highlight"><pre><span></span><code>E += (curl_back(H[t]) + J) / epsilon
|
|
</code></pre></div>
|
|
<p>which requires an additional step of <code>E += J / epsilon</code> which is not performed
|
|
by the generated function.</p>
|
|
<p>See <code>meanas.fdmath</code> for descriptions of</p>
|
|
<ul>
|
|
<li>This update step: "Maxwell's equations" section</li>
|
|
<li><code>dxes</code>: "Datastructure: dx_lists_t" section</li>
|
|
<li><code>epsilon</code>: "Permittivity and Permeability" section</li>
|
|
</ul>
|
|
<p>Also see the "Timestep" section of <code>meanas.fdtd</code> for a discussion of
|
|
the <code>dt</code> parameter.</p>
|
|
|
|
|
|
<p><span class="doc-section-title">Parameters:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
<th>Default</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>dt</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#float">float</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Timestep. See <code>meanas.fdtd</code> for details.</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>dxes</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" dx_lists_t
|
|
|
|
|
|
|
|
module-attribute
|
|
(meanas.fdmath.dx_lists_t)" href="#api-fdmath-meanas.fdmath.types.dx_lists_t">dx_lists_t</a> | None</code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Grid description; see <code>meanas.fdmath</code>.</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<code>None</code>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
<p><span class="doc-section-title">Returns:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" fdfield_updater_t
|
|
|
|
|
|
|
|
module-attribute
|
|
(meanas.fdmath.fdfield_updater_t)" href="#api-fdmath-meanas.fdmath.types.fdfield_updater_t">fdfield_updater_t</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Function <code>f(E_old, H_old, epsilon) -> E_new</code>.</p>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="doc doc-object doc-function">
|
|
|
|
|
|
<h3 id="api-fdtd-meanas.fdtd.base.maxwell_h" class="doc doc-heading">
|
|
<code class="doc-symbol doc-symbol-heading doc-symbol-function"></code> <span class="doc doc-object-name doc-function-name">maxwell_h</span>
|
|
|
|
|
|
<a href="#api-fdtd-meanas.fdtd.base.maxwell_h" class="headerlink" title="Permanent link">¶</a></h3>
|
|
<div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#api-fdtd-__codelineno-0-1"></a><span class="nf">maxwell_h</span><span class="p">(</span>
|
|
<a id="__codelineno-0-2" name="__codelineno-0-2" href="#api-fdtd-__codelineno-0-2"></a> <span class="n">dt</span><span class="p">:</span> <span class="nb">float</span><span class="p">,</span> <span class="n">dxes</span><span class="p">:</span> <span class="n">dx_lists_t</span> <span class="o">|</span> <span class="kc">None</span> <span class="o">=</span> <span class="kc">None</span>
|
|
<a id="__codelineno-0-3" name="__codelineno-0-3" href="#api-fdtd-__codelineno-0-3"></a><span class="p">)</span> <span class="o">-></span> <span class="n">fdfield_updater_t</span>
|
|
</code></pre></div>
|
|
|
|
<div class="doc doc-contents ">
|
|
|
|
<p>Build a function which performs part of the time-domain H-field update,</p>
|
|
<div class="highlight"><pre><span></span><code>H -= curl_forward(E[t]) / mu
|
|
</code></pre></div>
|
|
<p>The full update should be</p>
|
|
<div class="highlight"><pre><span></span><code>H -= (curl_forward(E[t]) + M) / mu
|
|
</code></pre></div>
|
|
<p>which requires an additional step of <code>H -= M / mu</code> which is not performed
|
|
by the generated function; this step can be omitted if there is no magnetic
|
|
current <code>M</code>.</p>
|
|
<p>See <code>meanas.fdmath</code> for descriptions of</p>
|
|
<ul>
|
|
<li>This update step: "Maxwell's equations" section</li>
|
|
<li><code>dxes</code>: "Datastructure: dx_lists_t" section</li>
|
|
<li><code>mu</code>: "Permittivity and Permeability" section</li>
|
|
</ul>
|
|
<p>Also see the "Timestep" section of <code>meanas.fdtd</code> for a discussion of
|
|
the <code>dt</code> parameter.</p>
|
|
|
|
|
|
<p><span class="doc-section-title">Parameters:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
<th>Default</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>dt</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#float">float</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Timestep. See <code>meanas.fdtd</code> for details.</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>dxes</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" dx_lists_t
|
|
|
|
|
|
|
|
module-attribute
|
|
(meanas.fdmath.dx_lists_t)" href="#api-fdmath-meanas.fdmath.types.dx_lists_t">dx_lists_t</a> | None</code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Grid description; see <code>meanas.fdmath</code>.</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<code>None</code>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
<p><span class="doc-section-title">Returns:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" fdfield_updater_t
|
|
|
|
|
|
|
|
module-attribute
|
|
(meanas.fdmath.fdfield_updater_t)" href="#api-fdmath-meanas.fdmath.types.fdfield_updater_t">fdfield_updater_t</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Function <code>f(E_old, H_old, epsilon) -> E_new</code>.</p>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="doc doc-object doc-module">
|
|
|
|
|
|
|
|
<h2 id="api-fdtd-meanas.fdtd.pml" class="doc doc-heading">
|
|
<code class="doc-symbol doc-symbol-heading doc-symbol-module"></code> <span class="doc doc-object-name doc-module-name">meanas.fdtd.pml</span>
|
|
|
|
|
|
<a href="#api-fdtd-meanas.fdtd.pml" class="headerlink" title="Permanent link">¶</a></h2>
|
|
|
|
<div class="doc doc-contents first">
|
|
|
|
<p>Convolutional perfectly matched layer (CPML) support for FDTD updates.</p>
|
|
<p>The helpers in this module construct per-face CPML parameters and then wrap the
|
|
standard Yee updates with the additional auxiliary <code>psi</code> fields needed by the
|
|
CPML recurrence.</p>
|
|
<p>The intended call pattern is:</p>
|
|
<ol>
|
|
<li>Build a <code>cpml_params[axis][polarity_index]</code> table with <code>cpml_params(...)</code>.</li>
|
|
<li>Pass that table into <code>updates_with_cpml(...)</code> together with <code>dt</code>, <code>dxes</code>, and
|
|
<code>epsilon</code>.</li>
|
|
<li>Advance the returned <code>update_E</code> / <code>update_H</code> closures in the simulation loop.</li>
|
|
</ol>
|
|
<p>Each face can be enabled or disabled independently by replacing one table entry
|
|
with <code>None</code>.</p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="doc doc-children">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="doc doc-object doc-function">
|
|
|
|
|
|
<h3 id="api-fdtd-meanas.fdtd.pml.cpml_params" class="doc doc-heading">
|
|
<code class="doc-symbol doc-symbol-heading doc-symbol-function"></code> <span class="doc doc-object-name doc-function-name">cpml_params</span>
|
|
|
|
|
|
<a href="#api-fdtd-meanas.fdtd.pml.cpml_params" class="headerlink" title="Permanent link">¶</a></h3>
|
|
<div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#api-fdtd-__codelineno-0-1"></a><span class="nf">cpml_params</span><span class="p">(</span>
|
|
<a id="__codelineno-0-2" name="__codelineno-0-2" href="#api-fdtd-__codelineno-0-2"></a> <span class="n">axis</span><span class="p">:</span> <span class="nb">int</span><span class="p">,</span>
|
|
<a id="__codelineno-0-3" name="__codelineno-0-3" href="#api-fdtd-__codelineno-0-3"></a> <span class="n">polarity</span><span class="p">:</span> <span class="nb">int</span><span class="p">,</span>
|
|
<a id="__codelineno-0-4" name="__codelineno-0-4" href="#api-fdtd-__codelineno-0-4"></a> <span class="n">dt</span><span class="p">:</span> <span class="nb">float</span><span class="p">,</span>
|
|
<a id="__codelineno-0-5" name="__codelineno-0-5" href="#api-fdtd-__codelineno-0-5"></a> <span class="n">thickness</span><span class="p">:</span> <span class="nb">int</span> <span class="o">=</span> <span class="mi">8</span><span class="p">,</span>
|
|
<a id="__codelineno-0-6" name="__codelineno-0-6" href="#api-fdtd-__codelineno-0-6"></a> <span class="n">ln_R_per_layer</span><span class="p">:</span> <span class="nb">float</span> <span class="o">=</span> <span class="o">-</span><span class="mf">1.6</span><span class="p">,</span>
|
|
<a id="__codelineno-0-7" name="__codelineno-0-7" href="#api-fdtd-__codelineno-0-7"></a> <span class="n">epsilon_eff</span><span class="p">:</span> <span class="nb">float</span> <span class="o">=</span> <span class="mi">1</span><span class="p">,</span>
|
|
<a id="__codelineno-0-8" name="__codelineno-0-8" href="#api-fdtd-__codelineno-0-8"></a> <span class="n">mu_eff</span><span class="p">:</span> <span class="nb">float</span> <span class="o">=</span> <span class="mi">1</span><span class="p">,</span>
|
|
<a id="__codelineno-0-9" name="__codelineno-0-9" href="#api-fdtd-__codelineno-0-9"></a> <span class="n">m</span><span class="p">:</span> <span class="nb">float</span> <span class="o">=</span> <span class="mf">3.5</span><span class="p">,</span>
|
|
<a id="__codelineno-0-10" name="__codelineno-0-10" href="#api-fdtd-__codelineno-0-10"></a> <span class="n">ma</span><span class="p">:</span> <span class="nb">float</span> <span class="o">=</span> <span class="mi">1</span><span class="p">,</span>
|
|
<a id="__codelineno-0-11" name="__codelineno-0-11" href="#api-fdtd-__codelineno-0-11"></a> <span class="n">cfs_alpha</span><span class="p">:</span> <span class="nb">float</span> <span class="o">=</span> <span class="mi">0</span><span class="p">,</span>
|
|
<a id="__codelineno-0-12" name="__codelineno-0-12" href="#api-fdtd-__codelineno-0-12"></a><span class="p">)</span> <span class="o">-></span> <span class="nb">dict</span><span class="p">[</span><span class="nb">str</span><span class="p">,</span> <span class="n">Any</span><span class="p">]</span>
|
|
</code></pre></div>
|
|
|
|
<div class="doc doc-contents ">
|
|
|
|
<p>Construct the parameter block for one CPML face.</p>
|
|
|
|
|
|
<p><span class="doc-section-title">Parameters:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
<th>Default</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>axis</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#index-recommended-starting-points">int</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Which Cartesian axis the CPML is normal to (<code>0</code>, <code>1</code>, or <code>2</code>).</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>polarity</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#index-recommended-starting-points">int</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Which face along that axis (<code>-1</code> for the low-index face,
|
|
<code>+1</code> for the high-index face).</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>dt</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#float">float</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Timestep used by the Yee update.</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>thickness</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#index-recommended-starting-points">int</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Number of Yee cells occupied by the CPML region.</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<code>8</code>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>ln_R_per_layer</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#float">float</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Logarithmic attenuation target per layer.</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<code>-1.6</code>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>epsilon_eff</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#float">float</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Effective permittivity used when choosing the CPML scaling.</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<code>1</code>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>mu_eff</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#float">float</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Effective permeability used when choosing the CPML scaling.</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<code>1</code>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>m</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#float">float</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Polynomial grading exponent for <code>sigma</code> and <code>kappa</code>.</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<code>3.5</code>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>ma</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#float">float</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Polynomial grading exponent for the complex-frequency shift <code>alpha</code>.</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<code>1</code>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>cfs_alpha</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#float">float</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Maximum complex-frequency shift parameter.</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<code>0</code>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
<p><span class="doc-section-title">Returns:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#dict">dict</a>[<a class="autorefs autorefs-internal" href="#api-fdmath-meanas.fdmath--datastructure-dx_lists_t">str</a>, <a class="autorefs autorefs-internal" title="typing.Any" href="#typing.Any">Any</a>]</code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Dictionary with:</p>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#dict">dict</a>[<a class="autorefs autorefs-internal" href="#api-fdmath-meanas.fdmath--datastructure-dx_lists_t">str</a>, <a class="autorefs autorefs-internal" title="typing.Any" href="#typing.Any">Any</a>]</code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<ul>
|
|
<li><code>param_e</code>: <code>(p0, p1, p2)</code> arrays for the E update</li>
|
|
</ul>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#dict">dict</a>[<a class="autorefs autorefs-internal" href="#api-fdmath-meanas.fdmath--datastructure-dx_lists_t">str</a>, <a class="autorefs autorefs-internal" title="typing.Any" href="#typing.Any">Any</a>]</code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<ul>
|
|
<li><code>param_h</code>: <code>(p0, p1, p2)</code> arrays for the H update</li>
|
|
</ul>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#dict">dict</a>[<a class="autorefs autorefs-internal" href="#api-fdmath-meanas.fdmath--datastructure-dx_lists_t">str</a>, <a class="autorefs autorefs-internal" title="typing.Any" href="#typing.Any">Any</a>]</code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<ul>
|
|
<li><code>region</code>: slice tuple selecting the CPML cells on that face</li>
|
|
</ul>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="doc doc-object doc-function">
|
|
|
|
|
|
<h3 id="api-fdtd-meanas.fdtd.pml.updates_with_cpml" class="doc doc-heading">
|
|
<code class="doc-symbol doc-symbol-heading doc-symbol-function"></code> <span class="doc doc-object-name doc-function-name">updates_with_cpml</span>
|
|
|
|
|
|
<a href="#api-fdtd-meanas.fdtd.pml.updates_with_cpml" class="headerlink" title="Permanent link">¶</a></h3>
|
|
<div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#api-fdtd-__codelineno-0-1"></a><span class="nf">updates_with_cpml</span><span class="p">(</span>
|
|
<a id="__codelineno-0-2" name="__codelineno-0-2" href="#api-fdtd-__codelineno-0-2"></a> <span class="n">cpml_params</span><span class="p">:</span> <span class="n">Sequence</span><span class="p">[</span><span class="n">Sequence</span><span class="p">[</span><span class="nb">dict</span><span class="p">[</span><span class="nb">str</span><span class="p">,</span> <span class="n">Any</span><span class="p">]</span> <span class="o">|</span> <span class="kc">None</span><span class="p">]],</span>
|
|
<a id="__codelineno-0-3" name="__codelineno-0-3" href="#api-fdtd-__codelineno-0-3"></a> <span class="n">dt</span><span class="p">:</span> <span class="nb">float</span><span class="p">,</span>
|
|
<a id="__codelineno-0-4" name="__codelineno-0-4" href="#api-fdtd-__codelineno-0-4"></a> <span class="n">dxes</span><span class="p">:</span> <span class="n">dx_lists_t</span><span class="p">,</span>
|
|
<a id="__codelineno-0-5" name="__codelineno-0-5" href="#api-fdtd-__codelineno-0-5"></a> <span class="n">epsilon</span><span class="p">:</span> <span class="n">fdfield</span><span class="p">,</span>
|
|
<a id="__codelineno-0-6" name="__codelineno-0-6" href="#api-fdtd-__codelineno-0-6"></a> <span class="o">*</span><span class="p">,</span>
|
|
<a id="__codelineno-0-7" name="__codelineno-0-7" href="#api-fdtd-__codelineno-0-7"></a> <span class="n">dtype</span><span class="p">:</span> <span class="n">DTypeLike</span> <span class="o">=</span> <span class="n">numpy</span><span class="o">.</span><span class="n">float32</span><span class="p">,</span>
|
|
<a id="__codelineno-0-8" name="__codelineno-0-8" href="#api-fdtd-__codelineno-0-8"></a><span class="p">)</span> <span class="o">-></span> <span class="nb">tuple</span><span class="p">[</span>
|
|
<a id="__codelineno-0-9" name="__codelineno-0-9" href="#api-fdtd-__codelineno-0-9"></a> <span class="n">Callable</span><span class="p">[[</span><span class="n">fdfield_t</span><span class="p">,</span> <span class="n">fdfield_t</span><span class="p">,</span> <span class="n">fdfield_t</span><span class="p">],</span> <span class="kc">None</span><span class="p">],</span>
|
|
<a id="__codelineno-0-10" name="__codelineno-0-10" href="#api-fdtd-__codelineno-0-10"></a> <span class="n">Callable</span><span class="p">[[</span><span class="n">fdfield_t</span><span class="p">,</span> <span class="n">fdfield_t</span><span class="p">,</span> <span class="n">fdfield_t</span><span class="p">],</span> <span class="kc">None</span><span class="p">],</span>
|
|
<a id="__codelineno-0-11" name="__codelineno-0-11" href="#api-fdtd-__codelineno-0-11"></a><span class="p">]</span>
|
|
</code></pre></div>
|
|
|
|
<div class="doc doc-contents ">
|
|
|
|
<p>Build Yee-step update closures augmented with CPML terms.</p>
|
|
|
|
|
|
<p><span class="doc-section-title">Parameters:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
<th>Default</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>cpml_params</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title="collections.abc.Sequence" href="#collections.abc.Sequence">Sequence</a>[<a class="autorefs autorefs-internal" title="collections.abc.Sequence" href="#collections.abc.Sequence">Sequence</a>[<a class="autorefs autorefs-internal" href="#dict">dict</a>[<a class="autorefs autorefs-internal" href="#api-fdmath-meanas.fdmath--datastructure-dx_lists_t">str</a>, <a class="autorefs autorefs-internal" title="typing.Any" href="#typing.Any">Any</a>] | None]]</code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Three-by-two sequence indexed as <code>[axis][polarity_index]</code>.
|
|
Entries are the dictionaries returned by <code>cpml_params(...)</code>; use
|
|
<code>None</code> to disable CPML on one face.</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>dt</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#float">float</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Timestep.</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>dxes</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" dx_lists_t
|
|
|
|
|
|
|
|
module-attribute
|
|
(meanas.fdmath.dx_lists_t)" href="#api-fdmath-meanas.fdmath.types.dx_lists_t">dx_lists_t</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Yee-grid spacing lists <code>[dx_e, dx_h]</code>.</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>epsilon</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" fdfield (meanas.fdmath.fdfield)" href="#api-fdmath-meanas.fdmath.types.fdfield">fdfield</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Electric material distribution used by the E update.</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>dtype</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title="numpy.typing.DTypeLike" href="#numpy.typing.DTypeLike">DTypeLike</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Storage dtype for the auxiliary CPML state arrays.</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title="numpy.float32" href="#numpy.float32">float32</a></code>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
<p><span class="doc-section-title">Returns:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title="collections.abc.Callable" href="#collections.abc.Callable">Callable</a>[[<a class="autorefs autorefs-internal" title="meanas.fdmath.fdfield_t" href="#meanas.fdmath.fdfield_t">fdfield_t</a>, <a class="autorefs autorefs-internal" title="meanas.fdmath.fdfield_t" href="#meanas.fdmath.fdfield_t">fdfield_t</a>, <a class="autorefs autorefs-internal" title="meanas.fdmath.fdfield_t" href="#meanas.fdmath.fdfield_t">fdfield_t</a>], None]</code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p><code>(update_E, update_H)</code> closures with the same call shape as the basic</p>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title="collections.abc.Callable" href="#collections.abc.Callable">Callable</a>[[<a class="autorefs autorefs-internal" title="meanas.fdmath.fdfield_t" href="#meanas.fdmath.fdfield_t">fdfield_t</a>, <a class="autorefs autorefs-internal" title="meanas.fdmath.fdfield_t" href="#meanas.fdmath.fdfield_t">fdfield_t</a>, <a class="autorefs autorefs-internal" title="meanas.fdmath.fdfield_t" href="#meanas.fdmath.fdfield_t">fdfield_t</a>], None]</code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Yee updates:</p>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#tuple">tuple</a>[<a class="autorefs autorefs-internal" title="collections.abc.Callable" href="#collections.abc.Callable">Callable</a>[[<a class="autorefs autorefs-internal" title="meanas.fdmath.fdfield_t" href="#meanas.fdmath.fdfield_t">fdfield_t</a>, <a class="autorefs autorefs-internal" title="meanas.fdmath.fdfield_t" href="#meanas.fdmath.fdfield_t">fdfield_t</a>, <a class="autorefs autorefs-internal" title="meanas.fdmath.fdfield_t" href="#meanas.fdmath.fdfield_t">fdfield_t</a>], None], <a class="autorefs autorefs-internal" title="collections.abc.Callable" href="#collections.abc.Callable">Callable</a>[[<a class="autorefs autorefs-internal" title="meanas.fdmath.fdfield_t" href="#meanas.fdmath.fdfield_t">fdfield_t</a>, <a class="autorefs autorefs-internal" title="meanas.fdmath.fdfield_t" href="#meanas.fdmath.fdfield_t">fdfield_t</a>, <a class="autorefs autorefs-internal" title="meanas.fdmath.fdfield_t" href="#meanas.fdmath.fdfield_t">fdfield_t</a>], None]]</code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<ul>
|
|
<li><code>update_E(e, h, epsilon)</code></li>
|
|
</ul>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#tuple">tuple</a>[<a class="autorefs autorefs-internal" title="collections.abc.Callable" href="#collections.abc.Callable">Callable</a>[[<a class="autorefs autorefs-internal" title="meanas.fdmath.fdfield_t" href="#meanas.fdmath.fdfield_t">fdfield_t</a>, <a class="autorefs autorefs-internal" title="meanas.fdmath.fdfield_t" href="#meanas.fdmath.fdfield_t">fdfield_t</a>, <a class="autorefs autorefs-internal" title="meanas.fdmath.fdfield_t" href="#meanas.fdmath.fdfield_t">fdfield_t</a>], None], <a class="autorefs autorefs-internal" title="collections.abc.Callable" href="#collections.abc.Callable">Callable</a>[[<a class="autorefs autorefs-internal" title="meanas.fdmath.fdfield_t" href="#meanas.fdmath.fdfield_t">fdfield_t</a>, <a class="autorefs autorefs-internal" title="meanas.fdmath.fdfield_t" href="#meanas.fdmath.fdfield_t">fdfield_t</a>, <a class="autorefs autorefs-internal" title="meanas.fdmath.fdfield_t" href="#meanas.fdmath.fdfield_t">fdfield_t</a>], None]]</code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<ul>
|
|
<li><code>update_H(e, h, mu)</code></li>
|
|
</ul>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#tuple">tuple</a>[<a class="autorefs autorefs-internal" title="collections.abc.Callable" href="#collections.abc.Callable">Callable</a>[[<a class="autorefs autorefs-internal" title="meanas.fdmath.fdfield_t" href="#meanas.fdmath.fdfield_t">fdfield_t</a>, <a class="autorefs autorefs-internal" title="meanas.fdmath.fdfield_t" href="#meanas.fdmath.fdfield_t">fdfield_t</a>, <a class="autorefs autorefs-internal" title="meanas.fdmath.fdfield_t" href="#meanas.fdmath.fdfield_t">fdfield_t</a>], None], <a class="autorefs autorefs-internal" title="collections.abc.Callable" href="#collections.abc.Callable">Callable</a>[[<a class="autorefs autorefs-internal" title="meanas.fdmath.fdfield_t" href="#meanas.fdmath.fdfield_t">fdfield_t</a>, <a class="autorefs autorefs-internal" title="meanas.fdmath.fdfield_t" href="#meanas.fdmath.fdfield_t">fdfield_t</a>, <a class="autorefs autorefs-internal" title="meanas.fdmath.fdfield_t" href="#meanas.fdmath.fdfield_t">fdfield_t</a>], None]]</code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>The closures retain the CPML auxiliary state internally.</p>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="doc doc-object doc-module">
|
|
|
|
|
|
|
|
<h2 id="api-fdtd-meanas.fdtd.boundaries" class="doc doc-heading">
|
|
<code class="doc-symbol doc-symbol-heading doc-symbol-module"></code> <span class="doc doc-object-name doc-module-name">meanas.fdtd.boundaries</span>
|
|
|
|
|
|
<a href="#api-fdtd-meanas.fdtd.boundaries" class="headerlink" title="Permanent link">¶</a></h2>
|
|
|
|
<div class="doc doc-contents first">
|
|
|
|
<p>Boundary conditions</p>
|
|
<h3 id="api-fdtd-meanas.fdtd.boundaries--todo-conducting-boundary-documentation">TODO conducting boundary documentation<a class="headerlink" href="#api-fdtd-meanas.fdtd.boundaries--todo-conducting-boundary-documentation" title="Permanent link">¶</a></h3>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="doc doc-children">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="doc doc-object doc-module">
|
|
|
|
|
|
|
|
<h2 id="api-fdtd-meanas.fdtd.energy" class="doc doc-heading">
|
|
<code class="doc-symbol doc-symbol-heading doc-symbol-module"></code> <span class="doc doc-object-name doc-module-name">meanas.fdtd.energy</span>
|
|
|
|
|
|
<a href="#api-fdtd-meanas.fdtd.energy" class="headerlink" title="Permanent link">¶</a></h2>
|
|
|
|
<div class="doc doc-contents first">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="doc doc-children">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="doc doc-object doc-function">
|
|
|
|
|
|
<h3 id="api-fdtd-meanas.fdtd.energy.poynting" class="doc doc-heading">
|
|
<code class="doc-symbol doc-symbol-heading doc-symbol-function"></code> <span class="doc doc-object-name doc-function-name">poynting</span>
|
|
|
|
|
|
<a href="#api-fdtd-meanas.fdtd.energy.poynting" class="headerlink" title="Permanent link">¶</a></h3>
|
|
<div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#api-fdtd-__codelineno-0-1"></a><span class="nf">poynting</span><span class="p">(</span>
|
|
<a id="__codelineno-0-2" name="__codelineno-0-2" href="#api-fdtd-__codelineno-0-2"></a> <span class="n">e</span><span class="p">:</span> <span class="n">fdfield</span><span class="p">,</span> <span class="n">h</span><span class="p">:</span> <span class="n">fdfield</span><span class="p">,</span> <span class="n">dxes</span><span class="p">:</span> <span class="n">dx_lists_t</span> <span class="o">|</span> <span class="kc">None</span> <span class="o">=</span> <span class="kc">None</span>
|
|
<a id="__codelineno-0-3" name="__codelineno-0-3" href="#api-fdtd-__codelineno-0-3"></a><span class="p">)</span> <span class="o">-></span> <span class="n">fdfield_t</span>
|
|
</code></pre></div>
|
|
|
|
<div class="doc doc-contents ">
|
|
|
|
<p>Calculate the poynting vector <code>S</code> (<span class="arithmatex">\(S\)</span>).</p>
|
|
<p>This is the energy transfer rate (amount of energy <code>U</code> per <code>dt</code> transferred
|
|
between adjacent cells) in each direction that happens during the half-step
|
|
bounded by the two provided fields.</p>
|
|
<p>The returned vector field <code>S</code> is the energy flow across +x, +y, and +z
|
|
boundaries of the corresponding <code>U</code> cell. For example,</p>
|
|
<div class="highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#api-fdtd-__codelineno-0-1"></a> mx = numpy.roll(mask, -1, axis=0)
|
|
<a id="__codelineno-0-2" name="__codelineno-0-2" href="#api-fdtd-__codelineno-0-2"></a> my = numpy.roll(mask, -1, axis=1)
|
|
<a id="__codelineno-0-3" name="__codelineno-0-3" href="#api-fdtd-__codelineno-0-3"></a> mz = numpy.roll(mask, -1, axis=2)
|
|
<a id="__codelineno-0-4" name="__codelineno-0-4" href="#api-fdtd-__codelineno-0-4"></a>
|
|
<a id="__codelineno-0-5" name="__codelineno-0-5" href="#api-fdtd-__codelineno-0-5"></a> u_hstep = fdtd.energy_hstep(e0=es[ii - 1], h1=hs[ii], e2=es[ii], **args)
|
|
<a id="__codelineno-0-6" name="__codelineno-0-6" href="#api-fdtd-__codelineno-0-6"></a> u_estep = fdtd.energy_estep(h0=hs[ii], e1=es[ii], h2=hs[ii + 1], **args)
|
|
<a id="__codelineno-0-7" name="__codelineno-0-7" href="#api-fdtd-__codelineno-0-7"></a> delta_j_B = fdtd.delta_energy_j(j0=js[ii], e1=es[ii], dxes=dxes)
|
|
<a id="__codelineno-0-8" name="__codelineno-0-8" href="#api-fdtd-__codelineno-0-8"></a> du_half_h2e = u_estep - u_hstep - delta_j_B
|
|
<a id="__codelineno-0-9" name="__codelineno-0-9" href="#api-fdtd-__codelineno-0-9"></a>
|
|
<a id="__codelineno-0-10" name="__codelineno-0-10" href="#api-fdtd-__codelineno-0-10"></a> s_h2e = -fdtd.poynting(e=es[ii], h=hs[ii], dxes=dxes) * dt
|
|
<a id="__codelineno-0-11" name="__codelineno-0-11" href="#api-fdtd-__codelineno-0-11"></a> planes = [s_h2e[0, mask].sum(), -s_h2e[0, mx].sum(),
|
|
<a id="__codelineno-0-12" name="__codelineno-0-12" href="#api-fdtd-__codelineno-0-12"></a> s_h2e[1, mask].sum(), -s_h2e[1, my].sum(),
|
|
<a id="__codelineno-0-13" name="__codelineno-0-13" href="#api-fdtd-__codelineno-0-13"></a> s_h2e[2, mask].sum(), -s_h2e[2, mz].sum()]
|
|
<a id="__codelineno-0-14" name="__codelineno-0-14" href="#api-fdtd-__codelineno-0-14"></a>
|
|
<a id="__codelineno-0-15" name="__codelineno-0-15" href="#api-fdtd-__codelineno-0-15"></a> assert_close(sum(planes), du_half_h2e[mask])
|
|
</code></pre></div>
|
|
<p>(see <code>meanas.tests.test_fdtd.test_poynting_planes</code>)</p>
|
|
<p>The full relationship is
|
|
$$
|
|
\begin{aligned}
|
|
(U_{l+\frac{1}{2}} - U_l) / \Delta_t
|
|
&= -\hat{\nabla} \cdot \tilde{S}<em l_frac_1="l+\frac{1">{l, l + \frac{1}{2}} \
|
|
- \hat{H}</em>}{2}} \cdot \hat{M<em l_frac_1="l+\frac{1">l \
|
|
- \tilde{E}_l \cdot \tilde{J}</em> \
|
|
(U_l - U_{l-\frac{1}{2}}) / \Delta_t
|
|
&= -\hat{\nabla} \cdot \tilde{S}}{2}<em l-_frac_1="l-\frac{1">{l, l - \frac{1}{2}} \
|
|
- \hat{H}</em>}{2}} \cdot \hat{M<em l-_frac_1="l-\frac{1">l \
|
|
- \tilde{E}_l \cdot \tilde{J}</em> \
|
|
\end{aligned}
|
|
$$}{2}</p>
|
|
<p>These equalities are exact and should practically hold to within numerical precision.
|
|
No time- or spatial-averaging is necessary. (See <code>meanas.fdtd</code> docs for derivation.)</p>
|
|
|
|
|
|
<p><span class="doc-section-title">Parameters:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
<th>Default</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>e</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" fdfield (meanas.fdmath.fdfield)" href="#api-fdmath-meanas.fdmath.types.fdfield">fdfield</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>E-field</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>h</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" fdfield (meanas.fdmath.fdfield)" href="#api-fdmath-meanas.fdmath.types.fdfield">fdfield</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>H-field (one half-timestep before or after <code>e</code>)</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>dxes</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" dx_lists_t
|
|
|
|
|
|
|
|
module-attribute
|
|
(meanas.fdmath.dx_lists_t)" href="#api-fdmath-meanas.fdmath.types.dx_lists_t">dx_lists_t</a> | None</code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Grid description; see <code>meanas.fdmath</code>.</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<code>None</code>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
<p><span class="doc-section-title">Returns:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th> <th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td><code>s</code></td> <td>
|
|
<code><a class="autorefs autorefs-internal" title="meanas.fdmath.fdfield_t" href="#meanas.fdmath.fdfield_t">fdfield_t</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Vector field. Components indicate the energy transfer rate from the
|
|
corresponding energy cell into its +x, +y, and +z neighbors during
|
|
the half-step from the time of the earlier input field until the
|
|
time of later input field.</p>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="doc doc-object doc-function">
|
|
|
|
|
|
<h3 id="api-fdtd-meanas.fdtd.energy.poynting_divergence" class="doc doc-heading">
|
|
<code class="doc-symbol doc-symbol-heading doc-symbol-function"></code> <span class="doc doc-object-name doc-function-name">poynting_divergence</span>
|
|
|
|
|
|
<a href="#api-fdtd-meanas.fdtd.energy.poynting_divergence" class="headerlink" title="Permanent link">¶</a></h3>
|
|
<div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#api-fdtd-__codelineno-0-1"></a><span class="nf">poynting_divergence</span><span class="p">(</span>
|
|
<a id="__codelineno-0-2" name="__codelineno-0-2" href="#api-fdtd-__codelineno-0-2"></a> <span class="n">s</span><span class="p">:</span> <span class="n">fdfield</span> <span class="o">|</span> <span class="kc">None</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
|
|
<a id="__codelineno-0-3" name="__codelineno-0-3" href="#api-fdtd-__codelineno-0-3"></a> <span class="o">*</span><span class="p">,</span>
|
|
<a id="__codelineno-0-4" name="__codelineno-0-4" href="#api-fdtd-__codelineno-0-4"></a> <span class="n">e</span><span class="p">:</span> <span class="n">fdfield</span> <span class="o">|</span> <span class="kc">None</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
|
|
<a id="__codelineno-0-5" name="__codelineno-0-5" href="#api-fdtd-__codelineno-0-5"></a> <span class="n">h</span><span class="p">:</span> <span class="n">fdfield</span> <span class="o">|</span> <span class="kc">None</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
|
|
<a id="__codelineno-0-6" name="__codelineno-0-6" href="#api-fdtd-__codelineno-0-6"></a> <span class="n">dxes</span><span class="p">:</span> <span class="n">dx_lists_t</span> <span class="o">|</span> <span class="kc">None</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
|
|
<a id="__codelineno-0-7" name="__codelineno-0-7" href="#api-fdtd-__codelineno-0-7"></a><span class="p">)</span> <span class="o">-></span> <span class="n">fdfield_t</span>
|
|
</code></pre></div>
|
|
|
|
<div class="doc doc-contents ">
|
|
|
|
<p>Calculate the divergence of the poynting vector.</p>
|
|
<p>This is the net energy flow for each cell, i.e. the change in energy <code>U</code>
|
|
per <code>dt</code> caused by transfer of energy to nearby cells (rather than
|
|
absorption/emission by currents <code>J</code> or <code>M</code>).</p>
|
|
<p>See <code>poynting</code> and <code>meanas.fdtd</code> for more details.
|
|
Args:
|
|
s: Poynting vector, as calculated with <code>poynting</code>. Optional; caller
|
|
can provide <code>e</code> and <code>h</code> instead.
|
|
e: E-field (optional; need either <code>s</code> or both <code>e</code> and <code>h</code>)
|
|
h: H-field (optional; need either <code>s</code> or both <code>e</code> and <code>h</code>)
|
|
dxes: Grid description; see <code>meanas.fdmath</code>.</p>
|
|
|
|
|
|
<p><span class="doc-section-title">Returns:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th> <th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td><code>ds</code></td> <td>
|
|
<code><a class="autorefs autorefs-internal" title="meanas.fdmath.fdfield_t" href="#meanas.fdmath.fdfield_t">fdfield_t</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Divergence of the poynting vector.
|
|
Entries indicate the net energy flow out of the corresponding
|
|
energy cell.</p>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="doc doc-object doc-function">
|
|
|
|
|
|
<h3 id="api-fdtd-meanas.fdtd.energy.energy_hstep" class="doc doc-heading">
|
|
<code class="doc-symbol doc-symbol-heading doc-symbol-function"></code> <span class="doc doc-object-name doc-function-name">energy_hstep</span>
|
|
|
|
|
|
<a href="#api-fdtd-meanas.fdtd.energy.energy_hstep" class="headerlink" title="Permanent link">¶</a></h3>
|
|
<div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#api-fdtd-__codelineno-0-1"></a><span class="nf">energy_hstep</span><span class="p">(</span>
|
|
<a id="__codelineno-0-2" name="__codelineno-0-2" href="#api-fdtd-__codelineno-0-2"></a> <span class="n">e0</span><span class="p">:</span> <span class="n">fdfield</span><span class="p">,</span>
|
|
<a id="__codelineno-0-3" name="__codelineno-0-3" href="#api-fdtd-__codelineno-0-3"></a> <span class="n">h1</span><span class="p">:</span> <span class="n">fdfield</span><span class="p">,</span>
|
|
<a id="__codelineno-0-4" name="__codelineno-0-4" href="#api-fdtd-__codelineno-0-4"></a> <span class="n">e2</span><span class="p">:</span> <span class="n">fdfield</span><span class="p">,</span>
|
|
<a id="__codelineno-0-5" name="__codelineno-0-5" href="#api-fdtd-__codelineno-0-5"></a> <span class="n">epsilon</span><span class="p">:</span> <span class="n">fdfield</span> <span class="o">|</span> <span class="kc">None</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
|
|
<a id="__codelineno-0-6" name="__codelineno-0-6" href="#api-fdtd-__codelineno-0-6"></a> <span class="n">mu</span><span class="p">:</span> <span class="n">fdfield</span> <span class="o">|</span> <span class="kc">None</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
|
|
<a id="__codelineno-0-7" name="__codelineno-0-7" href="#api-fdtd-__codelineno-0-7"></a> <span class="n">dxes</span><span class="p">:</span> <span class="n">dx_lists_t</span> <span class="o">|</span> <span class="kc">None</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
|
|
<a id="__codelineno-0-8" name="__codelineno-0-8" href="#api-fdtd-__codelineno-0-8"></a><span class="p">)</span> <span class="o">-></span> <span class="n">fdfield_t</span>
|
|
</code></pre></div>
|
|
|
|
<div class="doc doc-contents ">
|
|
|
|
<p>Calculate energy <code>U</code> at the time of the provided H-field <code>h1</code>.</p>
|
|
<p>TODO: Figure out what this means spatially.</p>
|
|
|
|
|
|
<p><span class="doc-section-title">Parameters:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
<th>Default</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>e0</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" fdfield (meanas.fdmath.fdfield)" href="#api-fdmath-meanas.fdmath.types.fdfield">fdfield</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>E-field one half-timestep before the energy.</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>h1</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" fdfield (meanas.fdmath.fdfield)" href="#api-fdmath-meanas.fdmath.types.fdfield">fdfield</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>H-field (at the same timestep as the energy).</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>e2</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" fdfield (meanas.fdmath.fdfield)" href="#api-fdmath-meanas.fdmath.types.fdfield">fdfield</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>E-field one half-timestep after the energy.</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>epsilon</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" fdfield (meanas.fdmath.fdfield)" href="#api-fdmath-meanas.fdmath.types.fdfield">fdfield</a> | None</code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Dielectric constant distribution.</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<code>None</code>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>mu</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" fdfield (meanas.fdmath.fdfield)" href="#api-fdmath-meanas.fdmath.types.fdfield">fdfield</a> | None</code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Magnetic permeability distribution.</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<code>None</code>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>dxes</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" dx_lists_t
|
|
|
|
|
|
|
|
module-attribute
|
|
(meanas.fdmath.dx_lists_t)" href="#api-fdmath-meanas.fdmath.types.dx_lists_t">dx_lists_t</a> | None</code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Grid description; see <code>meanas.fdmath</code>.</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<code>None</code>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
<p><span class="doc-section-title">Returns:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title="meanas.fdmath.fdfield_t" href="#meanas.fdmath.fdfield_t">fdfield_t</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Energy, at the time of the H-field <code>h1</code>.</p>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="doc doc-object doc-function">
|
|
|
|
|
|
<h3 id="api-fdtd-meanas.fdtd.energy.energy_estep" class="doc doc-heading">
|
|
<code class="doc-symbol doc-symbol-heading doc-symbol-function"></code> <span class="doc doc-object-name doc-function-name">energy_estep</span>
|
|
|
|
|
|
<a href="#api-fdtd-meanas.fdtd.energy.energy_estep" class="headerlink" title="Permanent link">¶</a></h3>
|
|
<div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#api-fdtd-__codelineno-0-1"></a><span class="nf">energy_estep</span><span class="p">(</span>
|
|
<a id="__codelineno-0-2" name="__codelineno-0-2" href="#api-fdtd-__codelineno-0-2"></a> <span class="n">h0</span><span class="p">:</span> <span class="n">fdfield</span><span class="p">,</span>
|
|
<a id="__codelineno-0-3" name="__codelineno-0-3" href="#api-fdtd-__codelineno-0-3"></a> <span class="n">e1</span><span class="p">:</span> <span class="n">fdfield</span><span class="p">,</span>
|
|
<a id="__codelineno-0-4" name="__codelineno-0-4" href="#api-fdtd-__codelineno-0-4"></a> <span class="n">h2</span><span class="p">:</span> <span class="n">fdfield</span><span class="p">,</span>
|
|
<a id="__codelineno-0-5" name="__codelineno-0-5" href="#api-fdtd-__codelineno-0-5"></a> <span class="n">epsilon</span><span class="p">:</span> <span class="n">fdfield</span> <span class="o">|</span> <span class="kc">None</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
|
|
<a id="__codelineno-0-6" name="__codelineno-0-6" href="#api-fdtd-__codelineno-0-6"></a> <span class="n">mu</span><span class="p">:</span> <span class="n">fdfield</span> <span class="o">|</span> <span class="kc">None</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
|
|
<a id="__codelineno-0-7" name="__codelineno-0-7" href="#api-fdtd-__codelineno-0-7"></a> <span class="n">dxes</span><span class="p">:</span> <span class="n">dx_lists_t</span> <span class="o">|</span> <span class="kc">None</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
|
|
<a id="__codelineno-0-8" name="__codelineno-0-8" href="#api-fdtd-__codelineno-0-8"></a><span class="p">)</span> <span class="o">-></span> <span class="n">fdfield_t</span>
|
|
</code></pre></div>
|
|
|
|
<div class="doc doc-contents ">
|
|
|
|
<p>Calculate energy <code>U</code> at the time of the provided E-field <code>e1</code>.</p>
|
|
<p>TODO: Figure out what this means spatially.</p>
|
|
|
|
|
|
<p><span class="doc-section-title">Parameters:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
<th>Default</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>h0</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" fdfield (meanas.fdmath.fdfield)" href="#api-fdmath-meanas.fdmath.types.fdfield">fdfield</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>H-field one half-timestep before the energy.</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>e1</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" fdfield (meanas.fdmath.fdfield)" href="#api-fdmath-meanas.fdmath.types.fdfield">fdfield</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>E-field (at the same timestep as the energy).</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>h2</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" fdfield (meanas.fdmath.fdfield)" href="#api-fdmath-meanas.fdmath.types.fdfield">fdfield</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>H-field one half-timestep after the energy.</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>epsilon</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" fdfield (meanas.fdmath.fdfield)" href="#api-fdmath-meanas.fdmath.types.fdfield">fdfield</a> | None</code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Dielectric constant distribution.</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<code>None</code>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>mu</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" fdfield (meanas.fdmath.fdfield)" href="#api-fdmath-meanas.fdmath.types.fdfield">fdfield</a> | None</code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Magnetic permeability distribution.</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<code>None</code>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>dxes</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" dx_lists_t
|
|
|
|
|
|
|
|
module-attribute
|
|
(meanas.fdmath.dx_lists_t)" href="#api-fdmath-meanas.fdmath.types.dx_lists_t">dx_lists_t</a> | None</code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Grid description; see <code>meanas.fdmath</code>.</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<code>None</code>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
<p><span class="doc-section-title">Returns:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title="meanas.fdmath.fdfield_t" href="#meanas.fdmath.fdfield_t">fdfield_t</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Energy, at the time of the E-field <code>e1</code>.</p>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="doc doc-object doc-function">
|
|
|
|
|
|
<h3 id="api-fdtd-meanas.fdtd.energy.delta_energy_h2e" class="doc doc-heading">
|
|
<code class="doc-symbol doc-symbol-heading doc-symbol-function"></code> <span class="doc doc-object-name doc-function-name">delta_energy_h2e</span>
|
|
|
|
|
|
<a href="#api-fdtd-meanas.fdtd.energy.delta_energy_h2e" class="headerlink" title="Permanent link">¶</a></h3>
|
|
<div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#api-fdtd-__codelineno-0-1"></a><span class="nf">delta_energy_h2e</span><span class="p">(</span>
|
|
<a id="__codelineno-0-2" name="__codelineno-0-2" href="#api-fdtd-__codelineno-0-2"></a> <span class="n">dt</span><span class="p">:</span> <span class="nb">float</span><span class="p">,</span>
|
|
<a id="__codelineno-0-3" name="__codelineno-0-3" href="#api-fdtd-__codelineno-0-3"></a> <span class="n">e0</span><span class="p">:</span> <span class="n">fdfield</span><span class="p">,</span>
|
|
<a id="__codelineno-0-4" name="__codelineno-0-4" href="#api-fdtd-__codelineno-0-4"></a> <span class="n">h1</span><span class="p">:</span> <span class="n">fdfield</span><span class="p">,</span>
|
|
<a id="__codelineno-0-5" name="__codelineno-0-5" href="#api-fdtd-__codelineno-0-5"></a> <span class="n">e2</span><span class="p">:</span> <span class="n">fdfield</span><span class="p">,</span>
|
|
<a id="__codelineno-0-6" name="__codelineno-0-6" href="#api-fdtd-__codelineno-0-6"></a> <span class="n">h3</span><span class="p">:</span> <span class="n">fdfield</span><span class="p">,</span>
|
|
<a id="__codelineno-0-7" name="__codelineno-0-7" href="#api-fdtd-__codelineno-0-7"></a> <span class="n">epsilon</span><span class="p">:</span> <span class="n">fdfield</span> <span class="o">|</span> <span class="kc">None</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
|
|
<a id="__codelineno-0-8" name="__codelineno-0-8" href="#api-fdtd-__codelineno-0-8"></a> <span class="n">mu</span><span class="p">:</span> <span class="n">fdfield</span> <span class="o">|</span> <span class="kc">None</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
|
|
<a id="__codelineno-0-9" name="__codelineno-0-9" href="#api-fdtd-__codelineno-0-9"></a> <span class="n">dxes</span><span class="p">:</span> <span class="n">dx_lists_t</span> <span class="o">|</span> <span class="kc">None</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
|
|
<a id="__codelineno-0-10" name="__codelineno-0-10" href="#api-fdtd-__codelineno-0-10"></a><span class="p">)</span> <span class="o">-></span> <span class="n">fdfield_t</span>
|
|
</code></pre></div>
|
|
|
|
<div class="doc doc-contents ">
|
|
|
|
<p>Change in energy during the half-step from <code>h1</code> to <code>e2</code>.</p>
|
|
<p>This is just from (e2 * e2 + h3 * h1) - (h1 * h1 + e0 * e2)</p>
|
|
|
|
|
|
<p><span class="doc-section-title">Parameters:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
<th>Default</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>e0</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" fdfield (meanas.fdmath.fdfield)" href="#api-fdmath-meanas.fdmath.types.fdfield">fdfield</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>E-field one half-timestep before the start of the energy delta.</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>h1</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" fdfield (meanas.fdmath.fdfield)" href="#api-fdmath-meanas.fdmath.types.fdfield">fdfield</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>H-field at the start of the energy delta.</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>e2</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" fdfield (meanas.fdmath.fdfield)" href="#api-fdmath-meanas.fdmath.types.fdfield">fdfield</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>E-field at the end of the energy delta (one half-timestep after <code>h1</code>).</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>h3</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" fdfield (meanas.fdmath.fdfield)" href="#api-fdmath-meanas.fdmath.types.fdfield">fdfield</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>H-field one half-timestep after the end of the energy delta.</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>epsilon</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" fdfield (meanas.fdmath.fdfield)" href="#api-fdmath-meanas.fdmath.types.fdfield">fdfield</a> | None</code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Dielectric constant distribution.</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<code>None</code>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>mu</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" fdfield (meanas.fdmath.fdfield)" href="#api-fdmath-meanas.fdmath.types.fdfield">fdfield</a> | None</code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Magnetic permeability distribution.</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<code>None</code>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>dxes</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" dx_lists_t
|
|
|
|
|
|
|
|
module-attribute
|
|
(meanas.fdmath.dx_lists_t)" href="#api-fdmath-meanas.fdmath.types.dx_lists_t">dx_lists_t</a> | None</code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Grid description; see <code>meanas.fdmath</code>.</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<code>None</code>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
<p><span class="doc-section-title">Returns:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title="meanas.fdmath.fdfield_t" href="#meanas.fdmath.fdfield_t">fdfield_t</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Change in energy from the time of <code>h1</code> to the time of <code>e2</code>.</p>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="doc doc-object doc-function">
|
|
|
|
|
|
<h3 id="api-fdtd-meanas.fdtd.energy.delta_energy_e2h" class="doc doc-heading">
|
|
<code class="doc-symbol doc-symbol-heading doc-symbol-function"></code> <span class="doc doc-object-name doc-function-name">delta_energy_e2h</span>
|
|
|
|
|
|
<a href="#api-fdtd-meanas.fdtd.energy.delta_energy_e2h" class="headerlink" title="Permanent link">¶</a></h3>
|
|
<div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#api-fdtd-__codelineno-0-1"></a><span class="nf">delta_energy_e2h</span><span class="p">(</span>
|
|
<a id="__codelineno-0-2" name="__codelineno-0-2" href="#api-fdtd-__codelineno-0-2"></a> <span class="n">dt</span><span class="p">:</span> <span class="nb">float</span><span class="p">,</span>
|
|
<a id="__codelineno-0-3" name="__codelineno-0-3" href="#api-fdtd-__codelineno-0-3"></a> <span class="n">h0</span><span class="p">:</span> <span class="n">fdfield</span><span class="p">,</span>
|
|
<a id="__codelineno-0-4" name="__codelineno-0-4" href="#api-fdtd-__codelineno-0-4"></a> <span class="n">e1</span><span class="p">:</span> <span class="n">fdfield</span><span class="p">,</span>
|
|
<a id="__codelineno-0-5" name="__codelineno-0-5" href="#api-fdtd-__codelineno-0-5"></a> <span class="n">h2</span><span class="p">:</span> <span class="n">fdfield</span><span class="p">,</span>
|
|
<a id="__codelineno-0-6" name="__codelineno-0-6" href="#api-fdtd-__codelineno-0-6"></a> <span class="n">e3</span><span class="p">:</span> <span class="n">fdfield</span><span class="p">,</span>
|
|
<a id="__codelineno-0-7" name="__codelineno-0-7" href="#api-fdtd-__codelineno-0-7"></a> <span class="n">epsilon</span><span class="p">:</span> <span class="n">fdfield</span> <span class="o">|</span> <span class="kc">None</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
|
|
<a id="__codelineno-0-8" name="__codelineno-0-8" href="#api-fdtd-__codelineno-0-8"></a> <span class="n">mu</span><span class="p">:</span> <span class="n">fdfield</span> <span class="o">|</span> <span class="kc">None</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
|
|
<a id="__codelineno-0-9" name="__codelineno-0-9" href="#api-fdtd-__codelineno-0-9"></a> <span class="n">dxes</span><span class="p">:</span> <span class="n">dx_lists_t</span> <span class="o">|</span> <span class="kc">None</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
|
|
<a id="__codelineno-0-10" name="__codelineno-0-10" href="#api-fdtd-__codelineno-0-10"></a><span class="p">)</span> <span class="o">-></span> <span class="n">fdfield_t</span>
|
|
</code></pre></div>
|
|
|
|
<div class="doc doc-contents ">
|
|
|
|
<p>Change in energy during the half-step from <code>e1</code> to <code>h2</code>.</p>
|
|
<p>This is just from (h2 * h2 + e3 * e1) - (e1 * e1 + h0 * h2)</p>
|
|
|
|
|
|
<p><span class="doc-section-title">Parameters:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
<th>Default</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>h0</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" fdfield (meanas.fdmath.fdfield)" href="#api-fdmath-meanas.fdmath.types.fdfield">fdfield</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>E-field one half-timestep before the start of the energy delta.</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>e1</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" fdfield (meanas.fdmath.fdfield)" href="#api-fdmath-meanas.fdmath.types.fdfield">fdfield</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>H-field at the start of the energy delta.</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>h2</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" fdfield (meanas.fdmath.fdfield)" href="#api-fdmath-meanas.fdmath.types.fdfield">fdfield</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>E-field at the end of the energy delta (one half-timestep after <code>e1</code>).</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>e3</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" fdfield (meanas.fdmath.fdfield)" href="#api-fdmath-meanas.fdmath.types.fdfield">fdfield</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>H-field one half-timestep after the end of the energy delta.</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>epsilon</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" fdfield (meanas.fdmath.fdfield)" href="#api-fdmath-meanas.fdmath.types.fdfield">fdfield</a> | None</code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Dielectric constant distribution.</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<code>None</code>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>mu</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" fdfield (meanas.fdmath.fdfield)" href="#api-fdmath-meanas.fdmath.types.fdfield">fdfield</a> | None</code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Magnetic permeability distribution.</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<code>None</code>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>dxes</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" dx_lists_t
|
|
|
|
|
|
|
|
module-attribute
|
|
(meanas.fdmath.dx_lists_t)" href="#api-fdmath-meanas.fdmath.types.dx_lists_t">dx_lists_t</a> | None</code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Grid description; see <code>meanas.fdmath</code>.</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<code>None</code>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
<p><span class="doc-section-title">Returns:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title="meanas.fdmath.fdfield_t" href="#meanas.fdmath.fdfield_t">fdfield_t</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Change in energy from the time of <code>e1</code> to the time of <code>h2</code>.</p>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="doc doc-object doc-function">
|
|
|
|
|
|
<h3 id="api-fdtd-meanas.fdtd.energy.delta_energy_j" class="doc doc-heading">
|
|
<code class="doc-symbol doc-symbol-heading doc-symbol-function"></code> <span class="doc doc-object-name doc-function-name">delta_energy_j</span>
|
|
|
|
|
|
<a href="#api-fdtd-meanas.fdtd.energy.delta_energy_j" class="headerlink" title="Permanent link">¶</a></h3>
|
|
<div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#api-fdtd-__codelineno-0-1"></a><span class="nf">delta_energy_j</span><span class="p">(</span>
|
|
<a id="__codelineno-0-2" name="__codelineno-0-2" href="#api-fdtd-__codelineno-0-2"></a> <span class="n">j0</span><span class="p">:</span> <span class="n">fdfield</span><span class="p">,</span> <span class="n">e1</span><span class="p">:</span> <span class="n">fdfield</span><span class="p">,</span> <span class="n">dxes</span><span class="p">:</span> <span class="n">dx_lists_t</span> <span class="o">|</span> <span class="kc">None</span> <span class="o">=</span> <span class="kc">None</span>
|
|
<a id="__codelineno-0-3" name="__codelineno-0-3" href="#api-fdtd-__codelineno-0-3"></a><span class="p">)</span> <span class="o">-></span> <span class="n">fdfield_t</span>
|
|
</code></pre></div>
|
|
|
|
<div class="doc doc-contents ">
|
|
|
|
<p>Calculate the electric-current work term <span class="arithmatex">\(J \cdot E\)</span> on the Yee grid.</p>
|
|
<p>This is the source contribution that appears beside the flux divergence in
|
|
the discrete Poynting identities documented in <code>meanas.fdtd</code>.</p>
|
|
<p>Note that each value of <code>J</code> contributes twice in a full Yee cycle (once per
|
|
half-step energy balance) even though it directly changes <code>E</code> only once.</p>
|
|
|
|
|
|
<p><span class="doc-section-title">Parameters:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
<th>Default</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>j0</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" fdfield (meanas.fdmath.fdfield)" href="#api-fdmath-meanas.fdmath.types.fdfield">fdfield</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Electric-current density sampled at the same half-step as the
|
|
current work term.</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>e1</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" fdfield (meanas.fdmath.fdfield)" href="#api-fdmath-meanas.fdmath.types.fdfield">fdfield</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Electric field sampled at the matching integer timestep.</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>dxes</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" dx_lists_t
|
|
|
|
|
|
|
|
module-attribute
|
|
(meanas.fdmath.dx_lists_t)" href="#api-fdmath-meanas.fdmath.types.dx_lists_t">dx_lists_t</a> | None</code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Grid description; defaults to unit spacing.</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<code>None</code>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
<p><span class="doc-section-title">Returns:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title="meanas.fdmath.fdfield_t" href="#meanas.fdmath.fdfield_t">fdfield_t</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Per-cell source-work contribution with the scalar field shape.</p>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="doc doc-object doc-function">
|
|
|
|
|
|
<h3 id="api-fdtd-meanas.fdtd.energy.dxmul" class="doc doc-heading">
|
|
<code class="doc-symbol doc-symbol-heading doc-symbol-function"></code> <span class="doc doc-object-name doc-function-name">dxmul</span>
|
|
|
|
|
|
<a href="#api-fdtd-meanas.fdtd.energy.dxmul" class="headerlink" title="Permanent link">¶</a></h3>
|
|
<div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#api-fdtd-__codelineno-0-1"></a><span class="nf">dxmul</span><span class="p">(</span>
|
|
<a id="__codelineno-0-2" name="__codelineno-0-2" href="#api-fdtd-__codelineno-0-2"></a> <span class="n">ee</span><span class="p">:</span> <span class="n">fdfield</span><span class="p">,</span>
|
|
<a id="__codelineno-0-3" name="__codelineno-0-3" href="#api-fdtd-__codelineno-0-3"></a> <span class="n">hh</span><span class="p">:</span> <span class="n">fdfield</span><span class="p">,</span>
|
|
<a id="__codelineno-0-4" name="__codelineno-0-4" href="#api-fdtd-__codelineno-0-4"></a> <span class="n">epsilon</span><span class="p">:</span> <span class="n">fdfield</span> <span class="o">|</span> <span class="nb">float</span> <span class="o">|</span> <span class="kc">None</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
|
|
<a id="__codelineno-0-5" name="__codelineno-0-5" href="#api-fdtd-__codelineno-0-5"></a> <span class="n">mu</span><span class="p">:</span> <span class="n">fdfield</span> <span class="o">|</span> <span class="nb">float</span> <span class="o">|</span> <span class="kc">None</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
|
|
<a id="__codelineno-0-6" name="__codelineno-0-6" href="#api-fdtd-__codelineno-0-6"></a> <span class="n">dxes</span><span class="p">:</span> <span class="n">dx_lists_t</span> <span class="o">|</span> <span class="kc">None</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
|
|
<a id="__codelineno-0-7" name="__codelineno-0-7" href="#api-fdtd-__codelineno-0-7"></a><span class="p">)</span> <span class="o">-></span> <span class="n">fdfield_t</span>
|
|
</code></pre></div>
|
|
|
|
<div class="doc doc-contents ">
|
|
|
|
<p>Multiply E- and H-like field products by material weights and cell volumes.</p>
|
|
|
|
|
|
<p><span class="doc-section-title">Parameters:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
<th>Default</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>ee</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" fdfield (meanas.fdmath.fdfield)" href="#api-fdmath-meanas.fdmath.types.fdfield">fdfield</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Three-component electric-field product, such as <code>e0 * e2</code>.</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>hh</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" fdfield (meanas.fdmath.fdfield)" href="#api-fdmath-meanas.fdmath.types.fdfield">fdfield</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Three-component magnetic-field product, such as <code>h1 * h1</code>.</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>epsilon</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" fdfield (meanas.fdmath.fdfield)" href="#api-fdmath-meanas.fdmath.types.fdfield">fdfield</a> | <a class="autorefs autorefs-internal" href="#float">float</a> | None</code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Electric material weight; defaults to <code>1</code>.</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<code>None</code>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>mu</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" fdfield (meanas.fdmath.fdfield)" href="#api-fdmath-meanas.fdmath.types.fdfield">fdfield</a> | <a class="autorefs autorefs-internal" href="#float">float</a> | None</code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Magnetic material weight; defaults to <code>1</code>.</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<code>None</code>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>dxes</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title=" dx_lists_t
|
|
|
|
|
|
|
|
module-attribute
|
|
(meanas.fdmath.dx_lists_t)" href="#api-fdmath-meanas.fdmath.types.dx_lists_t">dx_lists_t</a> | None</code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Grid description; defaults to unit spacing.</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<code>None</code>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
<p><span class="doc-section-title">Returns:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title="meanas.fdmath.fdfield_t" href="#meanas.fdmath.fdfield_t">fdfield_t</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Scalar field containing the weighted electric plus magnetic contribution</p>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title="meanas.fdmath.fdfield_t" href="#meanas.fdmath.fdfield_t">fdfield_t</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>for each Yee cell.</p>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="doc doc-object doc-module">
|
|
|
|
|
|
|
|
<h2 id="api-fdtd-meanas.fdtd.phasor" class="doc doc-heading">
|
|
<code class="doc-symbol doc-symbol-heading doc-symbol-module"></code> <span class="doc doc-object-name doc-module-name">meanas.fdtd.phasor</span>
|
|
|
|
|
|
<a href="#api-fdtd-meanas.fdtd.phasor" class="headerlink" title="Permanent link">¶</a></h2>
|
|
|
|
<div class="doc doc-contents first">
|
|
|
|
<p>Helpers for extracting single- or multi-frequency phasors from FDTD samples.</p>
|
|
<p>These helpers are intentionally low-level: callers own the accumulator arrays and
|
|
the sampling policy. The accumulated quantity is</p>
|
|
<div class="highlight"><pre><span></span><code>dt * sum(weight * exp(-1j * omega * t_step) * sample_step)
|
|
</code></pre></div>
|
|
<p>where <code>t_step = (step + offset_steps) * dt</code>.</p>
|
|
<p>The usual Yee offsets are:</p>
|
|
<ul>
|
|
<li><code>accumulate_phasor_e(..., step=l)</code> for <code>E_l</code></li>
|
|
<li><code>accumulate_phasor_h(..., step=l)</code> for <code>H_{l + 1/2}</code></li>
|
|
<li><code>accumulate_phasor_j(..., step=l)</code> for <code>J_{l + 1/2}</code></li>
|
|
</ul>
|
|
<p>These helpers do not choose warmup/accumulation windows or pulse-envelope
|
|
normalization. They also do not impose a current sign convention. In this
|
|
codebase, electric-current injection normally appears as <code>E -= dt * J / epsilon</code>,
|
|
which matches the FDFD right-hand side <code>-1j * omega * J</code>.</p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="doc doc-children">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="doc doc-object doc-function">
|
|
|
|
|
|
<h3 id="api-fdtd-meanas.fdtd.phasor.accumulate_phasor" class="doc doc-heading">
|
|
<code class="doc-symbol doc-symbol-heading doc-symbol-function"></code> <span class="doc doc-object-name doc-function-name">accumulate_phasor</span>
|
|
|
|
|
|
<a href="#api-fdtd-meanas.fdtd.phasor.accumulate_phasor" class="headerlink" title="Permanent link">¶</a></h3>
|
|
<div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#api-fdtd-__codelineno-0-1"></a><span class="nf">accumulate_phasor</span><span class="p">(</span>
|
|
<a id="__codelineno-0-2" name="__codelineno-0-2" href="#api-fdtd-__codelineno-0-2"></a> <span class="n">accumulator</span><span class="p">:</span> <span class="n">NDArray</span><span class="p">[</span><span class="n">complexfloating</span><span class="p">],</span>
|
|
<a id="__codelineno-0-3" name="__codelineno-0-3" href="#api-fdtd-__codelineno-0-3"></a> <span class="n">omegas</span><span class="p">:</span> <span class="nb">float</span>
|
|
<a id="__codelineno-0-4" name="__codelineno-0-4" href="#api-fdtd-__codelineno-0-4"></a> <span class="o">|</span> <span class="nb">complex</span>
|
|
<a id="__codelineno-0-5" name="__codelineno-0-5" href="#api-fdtd-__codelineno-0-5"></a> <span class="o">|</span> <span class="n">Sequence</span><span class="p">[</span><span class="nb">float</span> <span class="o">|</span> <span class="nb">complex</span><span class="p">]</span>
|
|
<a id="__codelineno-0-6" name="__codelineno-0-6" href="#api-fdtd-__codelineno-0-6"></a> <span class="o">|</span> <span class="n">NDArray</span><span class="p">,</span>
|
|
<a id="__codelineno-0-7" name="__codelineno-0-7" href="#api-fdtd-__codelineno-0-7"></a> <span class="n">dt</span><span class="p">:</span> <span class="nb">float</span><span class="p">,</span>
|
|
<a id="__codelineno-0-8" name="__codelineno-0-8" href="#api-fdtd-__codelineno-0-8"></a> <span class="n">sample</span><span class="p">:</span> <span class="n">ArrayLike</span><span class="p">,</span>
|
|
<a id="__codelineno-0-9" name="__codelineno-0-9" href="#api-fdtd-__codelineno-0-9"></a> <span class="n">step</span><span class="p">:</span> <span class="nb">int</span><span class="p">,</span>
|
|
<a id="__codelineno-0-10" name="__codelineno-0-10" href="#api-fdtd-__codelineno-0-10"></a> <span class="o">*</span><span class="p">,</span>
|
|
<a id="__codelineno-0-11" name="__codelineno-0-11" href="#api-fdtd-__codelineno-0-11"></a> <span class="n">offset_steps</span><span class="p">:</span> <span class="nb">float</span> <span class="o">=</span> <span class="mf">0.0</span><span class="p">,</span>
|
|
<a id="__codelineno-0-12" name="__codelineno-0-12" href="#api-fdtd-__codelineno-0-12"></a> <span class="n">weight</span><span class="p">:</span> <span class="n">ArrayLike</span> <span class="o">=</span> <span class="mf">1.0</span><span class="p">,</span>
|
|
<a id="__codelineno-0-13" name="__codelineno-0-13" href="#api-fdtd-__codelineno-0-13"></a><span class="p">)</span> <span class="o">-></span> <span class="n">NDArray</span><span class="p">[</span><span class="n">numpy</span><span class="o">.</span><span class="n">complexfloating</span><span class="p">]</span>
|
|
</code></pre></div>
|
|
|
|
<div class="doc doc-contents ">
|
|
|
|
<p>Add one time-domain sample into a phasor accumulator.</p>
|
|
<p>The added quantity is</p>
|
|
<div class="highlight"><pre><span></span><code>dt * weight * exp(-1j * omega * t_step) * sample
|
|
</code></pre></div>
|
|
<p>where <code>t_step = (step + offset_steps) * dt</code>.</p>
|
|
|
|
|
|
<details class="note" open>
|
|
<summary>Note</summary>
|
|
<p>This helper already multiplies by <code>dt</code>. If the caller's normalization
|
|
factor was derived from a discrete sum that already includes <code>dt</code>, pass
|
|
<code>weight / dt</code> here.</p>
|
|
</details>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="doc doc-object doc-function">
|
|
|
|
|
|
<h3 id="api-fdtd-meanas.fdtd.phasor.accumulate_phasor_e" class="doc doc-heading">
|
|
<code class="doc-symbol doc-symbol-heading doc-symbol-function"></code> <span class="doc doc-object-name doc-function-name">accumulate_phasor_e</span>
|
|
|
|
|
|
<a href="#api-fdtd-meanas.fdtd.phasor.accumulate_phasor_e" class="headerlink" title="Permanent link">¶</a></h3>
|
|
<div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#api-fdtd-__codelineno-0-1"></a><span class="nf">accumulate_phasor_e</span><span class="p">(</span>
|
|
<a id="__codelineno-0-2" name="__codelineno-0-2" href="#api-fdtd-__codelineno-0-2"></a> <span class="n">accumulator</span><span class="p">:</span> <span class="n">NDArray</span><span class="p">[</span><span class="n">complexfloating</span><span class="p">],</span>
|
|
<a id="__codelineno-0-3" name="__codelineno-0-3" href="#api-fdtd-__codelineno-0-3"></a> <span class="n">omegas</span><span class="p">:</span> <span class="nb">float</span>
|
|
<a id="__codelineno-0-4" name="__codelineno-0-4" href="#api-fdtd-__codelineno-0-4"></a> <span class="o">|</span> <span class="nb">complex</span>
|
|
<a id="__codelineno-0-5" name="__codelineno-0-5" href="#api-fdtd-__codelineno-0-5"></a> <span class="o">|</span> <span class="n">Sequence</span><span class="p">[</span><span class="nb">float</span> <span class="o">|</span> <span class="nb">complex</span><span class="p">]</span>
|
|
<a id="__codelineno-0-6" name="__codelineno-0-6" href="#api-fdtd-__codelineno-0-6"></a> <span class="o">|</span> <span class="n">NDArray</span><span class="p">,</span>
|
|
<a id="__codelineno-0-7" name="__codelineno-0-7" href="#api-fdtd-__codelineno-0-7"></a> <span class="n">dt</span><span class="p">:</span> <span class="nb">float</span><span class="p">,</span>
|
|
<a id="__codelineno-0-8" name="__codelineno-0-8" href="#api-fdtd-__codelineno-0-8"></a> <span class="n">sample</span><span class="p">:</span> <span class="n">ArrayLike</span><span class="p">,</span>
|
|
<a id="__codelineno-0-9" name="__codelineno-0-9" href="#api-fdtd-__codelineno-0-9"></a> <span class="n">step</span><span class="p">:</span> <span class="nb">int</span><span class="p">,</span>
|
|
<a id="__codelineno-0-10" name="__codelineno-0-10" href="#api-fdtd-__codelineno-0-10"></a> <span class="o">*</span><span class="p">,</span>
|
|
<a id="__codelineno-0-11" name="__codelineno-0-11" href="#api-fdtd-__codelineno-0-11"></a> <span class="n">weight</span><span class="p">:</span> <span class="n">ArrayLike</span> <span class="o">=</span> <span class="mf">1.0</span><span class="p">,</span>
|
|
<a id="__codelineno-0-12" name="__codelineno-0-12" href="#api-fdtd-__codelineno-0-12"></a><span class="p">)</span> <span class="o">-></span> <span class="n">NDArray</span><span class="p">[</span><span class="n">numpy</span><span class="o">.</span><span class="n">complexfloating</span><span class="p">]</span>
|
|
</code></pre></div>
|
|
|
|
<div class="doc doc-contents ">
|
|
|
|
<p>Accumulate an E-field sample taken at integer timestep <code>step</code>.</p>
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="doc doc-object doc-function">
|
|
|
|
|
|
<h3 id="api-fdtd-meanas.fdtd.phasor.accumulate_phasor_h" class="doc doc-heading">
|
|
<code class="doc-symbol doc-symbol-heading doc-symbol-function"></code> <span class="doc doc-object-name doc-function-name">accumulate_phasor_h</span>
|
|
|
|
|
|
<a href="#api-fdtd-meanas.fdtd.phasor.accumulate_phasor_h" class="headerlink" title="Permanent link">¶</a></h3>
|
|
<div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#api-fdtd-__codelineno-0-1"></a><span class="nf">accumulate_phasor_h</span><span class="p">(</span>
|
|
<a id="__codelineno-0-2" name="__codelineno-0-2" href="#api-fdtd-__codelineno-0-2"></a> <span class="n">accumulator</span><span class="p">:</span> <span class="n">NDArray</span><span class="p">[</span><span class="n">complexfloating</span><span class="p">],</span>
|
|
<a id="__codelineno-0-3" name="__codelineno-0-3" href="#api-fdtd-__codelineno-0-3"></a> <span class="n">omegas</span><span class="p">:</span> <span class="nb">float</span>
|
|
<a id="__codelineno-0-4" name="__codelineno-0-4" href="#api-fdtd-__codelineno-0-4"></a> <span class="o">|</span> <span class="nb">complex</span>
|
|
<a id="__codelineno-0-5" name="__codelineno-0-5" href="#api-fdtd-__codelineno-0-5"></a> <span class="o">|</span> <span class="n">Sequence</span><span class="p">[</span><span class="nb">float</span> <span class="o">|</span> <span class="nb">complex</span><span class="p">]</span>
|
|
<a id="__codelineno-0-6" name="__codelineno-0-6" href="#api-fdtd-__codelineno-0-6"></a> <span class="o">|</span> <span class="n">NDArray</span><span class="p">,</span>
|
|
<a id="__codelineno-0-7" name="__codelineno-0-7" href="#api-fdtd-__codelineno-0-7"></a> <span class="n">dt</span><span class="p">:</span> <span class="nb">float</span><span class="p">,</span>
|
|
<a id="__codelineno-0-8" name="__codelineno-0-8" href="#api-fdtd-__codelineno-0-8"></a> <span class="n">sample</span><span class="p">:</span> <span class="n">ArrayLike</span><span class="p">,</span>
|
|
<a id="__codelineno-0-9" name="__codelineno-0-9" href="#api-fdtd-__codelineno-0-9"></a> <span class="n">step</span><span class="p">:</span> <span class="nb">int</span><span class="p">,</span>
|
|
<a id="__codelineno-0-10" name="__codelineno-0-10" href="#api-fdtd-__codelineno-0-10"></a> <span class="o">*</span><span class="p">,</span>
|
|
<a id="__codelineno-0-11" name="__codelineno-0-11" href="#api-fdtd-__codelineno-0-11"></a> <span class="n">weight</span><span class="p">:</span> <span class="n">ArrayLike</span> <span class="o">=</span> <span class="mf">1.0</span><span class="p">,</span>
|
|
<a id="__codelineno-0-12" name="__codelineno-0-12" href="#api-fdtd-__codelineno-0-12"></a><span class="p">)</span> <span class="o">-></span> <span class="n">NDArray</span><span class="p">[</span><span class="n">numpy</span><span class="o">.</span><span class="n">complexfloating</span><span class="p">]</span>
|
|
</code></pre></div>
|
|
|
|
<div class="doc doc-contents ">
|
|
|
|
<p>Accumulate an H-field sample corresponding to <code>H_{step + 1/2}</code>.</p>
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="doc doc-object doc-function">
|
|
|
|
|
|
<h3 id="api-fdtd-meanas.fdtd.phasor.accumulate_phasor_j" class="doc doc-heading">
|
|
<code class="doc-symbol doc-symbol-heading doc-symbol-function"></code> <span class="doc doc-object-name doc-function-name">accumulate_phasor_j</span>
|
|
|
|
|
|
<a href="#api-fdtd-meanas.fdtd.phasor.accumulate_phasor_j" class="headerlink" title="Permanent link">¶</a></h3>
|
|
<div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#api-fdtd-__codelineno-0-1"></a><span class="nf">accumulate_phasor_j</span><span class="p">(</span>
|
|
<a id="__codelineno-0-2" name="__codelineno-0-2" href="#api-fdtd-__codelineno-0-2"></a> <span class="n">accumulator</span><span class="p">:</span> <span class="n">NDArray</span><span class="p">[</span><span class="n">complexfloating</span><span class="p">],</span>
|
|
<a id="__codelineno-0-3" name="__codelineno-0-3" href="#api-fdtd-__codelineno-0-3"></a> <span class="n">omegas</span><span class="p">:</span> <span class="nb">float</span>
|
|
<a id="__codelineno-0-4" name="__codelineno-0-4" href="#api-fdtd-__codelineno-0-4"></a> <span class="o">|</span> <span class="nb">complex</span>
|
|
<a id="__codelineno-0-5" name="__codelineno-0-5" href="#api-fdtd-__codelineno-0-5"></a> <span class="o">|</span> <span class="n">Sequence</span><span class="p">[</span><span class="nb">float</span> <span class="o">|</span> <span class="nb">complex</span><span class="p">]</span>
|
|
<a id="__codelineno-0-6" name="__codelineno-0-6" href="#api-fdtd-__codelineno-0-6"></a> <span class="o">|</span> <span class="n">NDArray</span><span class="p">,</span>
|
|
<a id="__codelineno-0-7" name="__codelineno-0-7" href="#api-fdtd-__codelineno-0-7"></a> <span class="n">dt</span><span class="p">:</span> <span class="nb">float</span><span class="p">,</span>
|
|
<a id="__codelineno-0-8" name="__codelineno-0-8" href="#api-fdtd-__codelineno-0-8"></a> <span class="n">sample</span><span class="p">:</span> <span class="n">ArrayLike</span><span class="p">,</span>
|
|
<a id="__codelineno-0-9" name="__codelineno-0-9" href="#api-fdtd-__codelineno-0-9"></a> <span class="n">step</span><span class="p">:</span> <span class="nb">int</span><span class="p">,</span>
|
|
<a id="__codelineno-0-10" name="__codelineno-0-10" href="#api-fdtd-__codelineno-0-10"></a> <span class="o">*</span><span class="p">,</span>
|
|
<a id="__codelineno-0-11" name="__codelineno-0-11" href="#api-fdtd-__codelineno-0-11"></a> <span class="n">weight</span><span class="p">:</span> <span class="n">ArrayLike</span> <span class="o">=</span> <span class="mf">1.0</span><span class="p">,</span>
|
|
<a id="__codelineno-0-12" name="__codelineno-0-12" href="#api-fdtd-__codelineno-0-12"></a><span class="p">)</span> <span class="o">-></span> <span class="n">NDArray</span><span class="p">[</span><span class="n">numpy</span><span class="o">.</span><span class="n">complexfloating</span><span class="p">]</span>
|
|
</code></pre></div>
|
|
|
|
<div class="doc doc-contents ">
|
|
|
|
<p>Accumulate a current sample corresponding to <code>J_{step + 1/2}</code>.</p>
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div></section><section class="print-page" id="api-fdmath" heading-number="2.7"><h1 id="api-fdmath-fdmath">fdmath<a class="headerlink" href="#api-fdmath-fdmath" title="Permanent link">¶</a></h1>
|
|
|
|
|
|
<div class="doc doc-object doc-module">
|
|
|
|
|
|
|
|
<h2 id="api-fdmath-meanas.fdmath" class="doc doc-heading">
|
|
<code class="doc-symbol doc-symbol-heading doc-symbol-module"></code> <span class="doc doc-object-name doc-module-name">meanas.fdmath</span>
|
|
|
|
|
|
<a href="#api-fdmath-meanas.fdmath" class="headerlink" title="Permanent link">¶</a></h2>
|
|
|
|
<div class="doc doc-contents first">
|
|
|
|
<p>Basic discrete calculus for finite difference (fd) simulations.</p>
|
|
<h3 id="api-fdmath-meanas.fdmath--fields-functions-and-operators">Fields, Functions, and Operators<a class="headerlink" href="#api-fdmath-meanas.fdmath--fields-functions-and-operators" title="Permanent link">¶</a></h3>
|
|
<p>Discrete fields are stored in one of two forms:</p>
|
|
<ul>
|
|
<li>The <code>fdfield_t</code> form is a multidimensional <code>numpy.NDArray</code><ul>
|
|
<li>For a scalar field, this is just <code>U[m, n, p]</code>, where <code>m</code>, <code>n</code>, and <code>p</code> are
|
|
discrete indices referring to positions on the x, y, and z axes respectively.</li>
|
|
<li>For a vector field, the first index specifies which vector component is accessed:
|
|
<code>E[:, m, n, p] = [Ex[m, n, p], Ey[m, n, p], Ez[m, n, p]]</code>.</li>
|
|
</ul>
|
|
</li>
|
|
<li>The <code>vfdfield_t</code> form is simply a vectorzied (i.e. 1D) version of the <code>fdfield_t</code>,
|
|
as obtained by <code>meanas.fdmath.vectorization.vec</code> (effectively just <code>numpy.ravel</code>)</li>
|
|
</ul>
|
|
|
|
|
|
<details class="operators-which-act-on-fields-also-come-in-two-forms" open>
|
|
<summary>Operators which act on fields also come in two forms</summary>
|
|
<ul>
|
|
<li>Python functions, created by the functions in <code>meanas.fdmath.functional</code>.
|
|
The generated functions act on fields in the <code>fdfield_t</code> form.</li>
|
|
<li>Linear operators, usually 2D sparse matrices using <code>scipy.sparse</code>, created
|
|
by <code>meanas.fdmath.operators</code>. These operators act on vectorized fields in the
|
|
<code>vfdfield_t</code> form.</li>
|
|
</ul>
|
|
</details> <p>The operations performed should be equivalent: <code>functional.op(*args)(E)</code> should be
|
|
equivalent to <code>unvec(operators.op(*args) @ vec(E), E.shape[1:])</code>.</p>
|
|
<p>Generally speaking the <code>field_t</code> form is easier to work with, but can be harder or less
|
|
efficient to compose (e.g. it is easy to generate a single matrix by multiplying a
|
|
series of other matrices).</p>
|
|
<h3 id="api-fdmath-meanas.fdmath--discrete-calculus">Discrete calculus<a class="headerlink" href="#api-fdmath-meanas.fdmath--discrete-calculus" title="Permanent link">¶</a></h3>
|
|
<p>This documentation and approach is roughly based on W.C. Chew's excellent
|
|
"Electromagnetic Theory on a Lattice" (doi:10.1063/1.355770),
|
|
which covers a superset of this material with similar notation and more detail.</p>
|
|
<h4 id="api-fdmath-meanas.fdmath--scalar-derivatives-and-cell-shifts">Scalar derivatives and cell shifts<a class="headerlink" href="#api-fdmath-meanas.fdmath--scalar-derivatives-and-cell-shifts" title="Permanent link">¶</a></h4>
|
|
<p>Define the discrete forward derivative as
|
|
$$ [\tilde{\partial}<em _="+" _frac_1="\frac{1" m="m">x f]</em> - f_m) $$
|
|
where }{2}} = \frac{1}{\Delta_{x, m}} (f_{m + 1<span class="arithmatex">\(f\)</span> is a function defined at discrete locations on the x-axis (labeled using <span class="arithmatex">\(m\)</span>).
|
|
The value at <span class="arithmatex">\(m\)</span> occupies a length <span class="arithmatex">\(\Delta_{x, m}\)</span> along the x-axis. Note that <span class="arithmatex">\(m\)</span>
|
|
is an index along the x-axis, <em>not</em> necessarily an x-coordinate, since each length
|
|
<span class="arithmatex">\(\Delta_{x, m}, \Delta_{x, m+1}, ...\)</span> is independently chosen.</p>
|
|
<p>If we treat <code>f</code> as a 1D array of values, with the <code>i</code>-th value <code>f[i]</code> taking up a length <code>dx[i]</code>
|
|
along the x-axis, the forward derivative is</p>
|
|
<div class="highlight"><pre><span></span><code>deriv_forward(f)[i] = (f[i + 1] - f[i]) / dx[i]
|
|
</code></pre></div>
|
|
<p>Likewise, discrete reverse derivative is
|
|
$$ [\hat{\partial}<em -="-" _frac_1="\frac{1" m="m">x f ]</em>) $$
|
|
or}{2}} = \frac{1}{\Delta_{x, m}} (f_{m} - f_{m - 1</p>
|
|
<div class="highlight"><pre><span></span><code>deriv_back(f)[i] = (f[i] - f[i - 1]) / dx[i]
|
|
</code></pre></div>
|
|
<p>The derivatives' values are shifted by a half-cell relative to the original function, and
|
|
will have different cell widths if all the <code>dx[i]</code> ( <span class="arithmatex">\(\Delta_{x, m}\)</span> ) are not
|
|
identical:</p>
|
|
<div class="highlight"><pre><span></span><code>[figure: derivatives and cell sizes]
|
|
dx0 dx1 dx2 dx3 cell sizes for function
|
|
----- ----- ----------- -----
|
|
______________________________
|
|
| | | |
|
|
f0 | f1 | f2 | f3 | function
|
|
_____|_____|___________|_____|
|
|
| | | |
|
|
| Df0 | Df1 | Df2 | Df3 forward derivative (periodic boundary)
|
|
__|_____|________|________|___
|
|
|
|
dx'3] dx'0 dx'1 dx'2 [dx'3 cell sizes for forward derivative
|
|
-- ----- -------- -------- ---
|
|
dx'0] dx'1 dx'2 dx'3 [dx'0 cell sizes for reverse derivative
|
|
______________________________
|
|
| | | |
|
|
| df1 | df2 | df3 | df0 reverse derivative (periodic boundary)
|
|
__|_____|________|________|___
|
|
|
|
Periodic boundaries are used here and elsewhere unless otherwise noted.
|
|
</code></pre></div>
|
|
<p>In the above figure,
|
|
<code>f0 =</code> <span class="arithmatex">\(f_0\)</span>, <code>f1 =</code> <span class="arithmatex">\(f_1\)</span>
|
|
<code>Df0 =</code> <span class="arithmatex">\([\tilde{\partial}f]_{0 + \frac{1}{2}}\)</span>
|
|
<code>Df1 =</code> <span class="arithmatex">\([\tilde{\partial}f]_{1 + \frac{1}{2}}\)</span>
|
|
<code>df0 =</code> <span class="arithmatex">\([\hat{\partial}f]_{0 - \frac{1}{2}}\)</span>
|
|
etc.</p>
|
|
<p>The fractional subscript <span class="arithmatex">\(m + \frac{1}{2}\)</span> is used to indicate values defined
|
|
at shifted locations relative to the original <span class="arithmatex">\(m\)</span>, with corresponding lengths
|
|
$$ \Delta_{x, m + \frac{1}{2}} = \frac{1}{2} * (\Delta_{x, m} + \Delta_{x, m + 1}) $$</p>
|
|
<p>Just as <span class="arithmatex">\(m\)</span> is not itself an x-coordinate, neither is <span class="arithmatex">\(m + \frac{1}{2}\)</span>;
|
|
carefully note the positions of the various cells in the above figure vs their labels.
|
|
If the positions labeled with <span class="arithmatex">\(m\)</span> are considered the "base" or "original" grid,
|
|
the positions labeled with <span class="arithmatex">\(m + \frac{1}{2}\)</span> are said to lie on a "dual" or
|
|
"derived" grid.</p>
|
|
<p>For the remainder of the <code>Discrete calculus</code> section, all figures will show
|
|
constant-length cells in order to focus on the vector derivatives themselves.
|
|
See the <code>Grid description</code> section below for additional information on this topic
|
|
and generalization to three dimensions.</p>
|
|
<h4 id="api-fdmath-meanas.fdmath--gradients-and-fore-vectors">Gradients and fore-vectors<a class="headerlink" href="#api-fdmath-meanas.fdmath--gradients-and-fore-vectors" title="Permanent link">¶</a></h4>
|
|
<p>Expanding to three dimensions, we can define two gradients
|
|
$$ [\tilde{\nabla} f]<em _="+" _frac_1="\frac{1" m="m">{m,n,p} = \vec{x} [\tilde{\partial}_x f]</em> +
|
|
\vec{y} [\tilde{\partial}}{2},n,p<em _="+" _frac_1="\frac{1" m_n="m,n">y f]</em> +
|
|
\vec{z} [\tilde{\partial}}{2},p<em _="+" _frac_1="\frac{1" m_n_p="m,n,p">z f]</em> $$
|
|
$$ [\hat{\nabla} f]}{2}<em _="+" _frac_1="\frac{1" m="m">{m,n,p} = \vec{x} [\hat{\partial}_x f]</em> +
|
|
\vec{y} [\hat{\partial}}{2},n,p<em _="+" _frac_1="\frac{1" m_n="m,n">y f]</em> +
|
|
\vec{z} [\hat{\partial}}{2},p<em _="+" _frac_1="\frac{1" m_n_p="m,n,p">z f]</em> $$}{2}</p>
|
|
<p>or</p>
|
|
<div class="highlight"><pre><span></span><code>[code: gradients]
|
|
grad_forward(f)[i,j,k] = [Dx_forward(f)[i, j, k],
|
|
Dy_forward(f)[i, j, k],
|
|
Dz_forward(f)[i, j, k]]
|
|
= [(f[i + 1, j, k] - f[i, j, k]) / dx[i],
|
|
(f[i, j + 1, k] - f[i, j, k]) / dy[i],
|
|
(f[i, j, k + 1] - f[i, j, k]) / dz[i]]
|
|
|
|
grad_back(f)[i,j,k] = [Dx_back(f)[i, j, k],
|
|
Dy_back(f)[i, j, k],
|
|
Dz_back(f)[i, j, k]]
|
|
= [(f[i, j, k] - f[i - 1, j, k]) / dx[i],
|
|
(f[i, j, k] - f[i, j - 1, k]) / dy[i],
|
|
(f[i, j, k] - f[i, j, k - 1]) / dz[i]]
|
|
</code></pre></div>
|
|
<p>The three derivatives in the gradient cause shifts in different
|
|
directions, so the x/y/z components of the resulting "vector" are defined
|
|
at different points: the x-component is shifted in the x-direction,
|
|
y in y, and z in z.</p>
|
|
<p>We call the resulting object a "fore-vector" or "back-vector", depending
|
|
on the direction of the shift. We write it as
|
|
$$ \tilde{g}<em _="+" _frac_1="\frac{1" m="m">{m,n,p} = \vec{x} g^x</em> +
|
|
\vec{y} g^y_{m,n + \frac{1}{2},p} +
|
|
\vec{z} g^z_{m,n,p + \frac{1}{2}} $$
|
|
$$ \hat{g}}{2},n,p<em -="-" _frac_1="\frac{1" m="m">{m,n,p} = \vec{x} g^x</em> +
|
|
\vec{y} g^y_{m,n - \frac{1}{2},p} +
|
|
\vec{z} g^z_{m,n,p - \frac{1}{2}} $$}{2},n,p</p>
|
|
<div class="highlight"><pre><span></span><code>[figure: gradient / fore-vector]
|
|
(m, n+1, p+1) ______________ (m+1, n+1, p+1)
|
|
/: /|
|
|
/ : / |
|
|
/ : / |
|
|
(m, n, p+1)/_____________/ | The forward derivatives are defined
|
|
| : | | at the Dx, Dy, Dz points,
|
|
| :.........|...| but the forward-gradient fore-vector
|
|
z y Dz / | / is the set of all three
|
|
|/_x | Dy | / and is said to be "located" at (m,n,p)
|
|
|/ |/
|
|
(m, n, p)|_____Dx______| (m+1, n, p)
|
|
</code></pre></div>
|
|
<h4 id="api-fdmath-meanas.fdmath--divergences">Divergences<a class="headerlink" href="#api-fdmath-meanas.fdmath--divergences" title="Permanent link">¶</a></h4>
|
|
<p>There are also two divergences,</p>
|
|
<p>$$ d_{n,m,p} = [\tilde{\nabla} \cdot \hat{g}]<em m_n_p="m,n,p">{n,m,p}
|
|
= [\tilde{\partial}_x g^x]</em> +
|
|
[\tilde{\partial}<em m_n_p="m,n,p">y g^y]</em> +
|
|
[\tilde{\partial}<em m_n_p="m,n,p">z g^z]</em> $$</p>
|
|
<p>$$ d_{n,m,p} = [\hat{\nabla} \cdot \tilde{g}]<em m_n_p="m,n,p">{n,m,p}
|
|
= [\hat{\partial}_x g^x]</em> +
|
|
[\hat{\partial}<em m_n_p="m,n,p">y g^y]</em> +
|
|
[\hat{\partial}<em m_n_p="m,n,p">z g^z]</em> $$</p>
|
|
<p>or</p>
|
|
<div class="highlight"><pre><span></span><code>[code: divergences]
|
|
div_forward(g)[i,j,k] = Dx_forward(gx)[i, j, k] +
|
|
Dy_forward(gy)[i, j, k] +
|
|
Dz_forward(gz)[i, j, k]
|
|
= (gx[i + 1, j, k] - gx[i, j, k]) / dx[i] +
|
|
(gy[i, j + 1, k] - gy[i, j, k]) / dy[i] +
|
|
(gz[i, j, k + 1] - gz[i, j, k]) / dz[i]
|
|
|
|
div_back(g)[i,j,k] = Dx_back(gx)[i, j, k] +
|
|
Dy_back(gy)[i, j, k] +
|
|
Dz_back(gz)[i, j, k]
|
|
= (gx[i, j, k] - gx[i - 1, j, k]) / dx[i] +
|
|
(gy[i, j, k] - gy[i, j - 1, k]) / dy[i] +
|
|
(gz[i, j, k] - gz[i, j, k - 1]) / dz[i]
|
|
</code></pre></div>
|
|
<p>where <code>g = [gx, gy, gz]</code> is a fore- or back-vector field.</p>
|
|
<p>Since we applied the forward divergence to the back-vector (and vice-versa), the resulting scalar value
|
|
is defined at the back-vector's (fore-vector's) location <span class="arithmatex">\((m,n,p)\)</span> and not at the locations of its components
|
|
<span class="arithmatex">\((m \pm \frac{1}{2},n,p)\)</span> etc.</p>
|
|
<div class="highlight"><pre><span></span><code>[figure: divergence]
|
|
^^
|
|
(m-1/2, n+1/2, p+1/2) _____||_______ (m+1/2, n+1/2, p+1/2)
|
|
/: || ,, /|
|
|
/ : || // / | The divergence at (m, n, p) (the center
|
|
/ : // / | of this cube) of a fore-vector field
|
|
(m-1/2, n-1/2, p+1/2)/_____________/ | is the sum of the outward-pointing
|
|
| : | | fore-vector components, which are
|
|
z y <==|== :.........|.====> located at the face centers.
|
|
|/_x | / | /
|
|
| / // | / Note that in a nonuniform grid, each
|
|
|/ // || |/ dimension is normalized by the cell width.
|
|
(m-1/2, n-1/2, p-1/2)|____//_______| (m+1/2, n-1/2, p-1/2)
|
|
'' ||
|
|
VV
|
|
</code></pre></div>
|
|
<h4 id="api-fdmath-meanas.fdmath--curls">Curls<a class="headerlink" href="#api-fdmath-meanas.fdmath--curls" title="Permanent link">¶</a></h4>
|
|
<p>The two curls are then</p>
|
|
<p>$$ \begin{aligned}
|
|
\hat{h}<em _="+" _frac_1="\frac{1" m="m">{m + \frac{1}{2}, n + \frac{1}{2}, p + \frac{1}{2}} &= \
|
|
[\tilde{\nabla} \times \tilde{g}]</em> &=
|
|
\vec{x} (\tilde{\partial}}{2}, n + \frac{1}{2}, p + \frac{1}{2}<em _="+" _frac_1="\frac{1" m_n_p="m,n,p">y g^z</em>}{2}} - \tilde{\partial<em _="+" _frac_1="\frac{1" m_n="m,n">z g^y</em>) \
|
|
&+ \vec{y} (\tilde{\partial}}{2},p<em _="+" _frac_1="\frac{1" m="m">z g^x</em>}{2},n,p} - \tilde{\partial<em _="+" _frac_1="\frac{1" m_n_p="m,n,p">x g^z</em>) \
|
|
&+ \vec{z} (\tilde{\partial}}{2}<em _="+" _frac_1="\frac{1" m_n="m,n">x g^y</em>}{2},p} - \tilde{\partial<em _="+" _frac_1="\frac{1" m="m">y g^z</em>)
|
|
\end{aligned} $$}{2},n,p</p>
|
|
<p>and</p>
|
|
<p>$$ \tilde{h}<em -="-" _frac_1="\frac{1" m="m">{m - \frac{1}{2}, n - \frac{1}{2}, p - \frac{1}{2}} =
|
|
[\hat{\nabla} \times \hat{g}]</em> $$}{2}, n - \frac{1}{2}, p - \frac{1}{2}</p>
|
|
<p>where <span class="arithmatex">\(\hat{g}\)</span> and <span class="arithmatex">\(\tilde{g}\)</span> are located at <span class="arithmatex">\((m,n,p)\)</span>
|
|
with components at <span class="arithmatex">\((m \pm \frac{1}{2},n,p)\)</span> etc.,
|
|
while <span class="arithmatex">\(\hat{h}\)</span> and <span class="arithmatex">\(\tilde{h}\)</span> are located at <span class="arithmatex">\((m \pm \frac{1}{2}, n \pm \frac{1}{2}, p \pm \frac{1}{2})\)</span>
|
|
with components at <span class="arithmatex">\((m, n \pm \frac{1}{2}, p \pm \frac{1}{2})\)</span> etc.</p>
|
|
<div class="highlight"><pre><span></span><code>[code: curls]
|
|
curl_forward(g)[i,j,k] = [Dy_forward(gz)[i, j, k] - Dz_forward(gy)[i, j, k],
|
|
Dz_forward(gx)[i, j, k] - Dx_forward(gz)[i, j, k],
|
|
Dx_forward(gy)[i, j, k] - Dy_forward(gx)[i, j, k]]
|
|
|
|
curl_back(g)[i,j,k] = [Dy_back(gz)[i, j, k] - Dz_back(gy)[i, j, k],
|
|
Dz_back(gx)[i, j, k] - Dx_back(gz)[i, j, k],
|
|
Dx_back(gy)[i, j, k] - Dy_back(gx)[i, j, k]]
|
|
</code></pre></div>
|
|
<p>For example, consider the forward curl, at (m, n, p), of a back-vector field <code>g</code>, defined
|
|
on a grid containing (m + 1/2, n + 1/2, p + 1/2).
|
|
The curl will be a fore-vector, so its z-component will be defined at (m, n, p + 1/2).
|
|
Take the nearest x- and y-components of <code>g</code> in the xy plane where the curl's z-component
|
|
is located; these are</p>
|
|
<div class="highlight"><pre><span></span><code>[curl components]
|
|
(m, n + 1/2, p + 1/2) : x-component of back-vector at (m + 1/2, n + 1/2, p + 1/2)
|
|
(m + 1, n + 1/2, p + 1/2) : x-component of back-vector at (m + 3/2, n + 1/2, p + 1/2)
|
|
(m + 1/2, n , p + 1/2) : y-component of back-vector at (m + 1/2, n + 1/2, p + 1/2)
|
|
(m + 1/2, n + 1 , p + 1/2) : y-component of back-vector at (m + 1/2, n + 3/2, p + 1/2)
|
|
</code></pre></div>
|
|
<p>These four xy-components can be used to form a loop around the curl's z-component; its magnitude and sign
|
|
is set by their loop-oriented sum (i.e. two have their signs flipped to complete the loop).</p>
|
|
<div class="highlight"><pre><span></span><code>[figure: z-component of curl]
|
|
: |
|
|
z y : ^^ |
|
|
|/_x :....||.<.....| (m+1, n+1, p+1/2)
|
|
/ || /
|
|
| v || | ^
|
|
|/ |/
|
|
(m, n, p+1/2) |_____>______| (m+1, n, p+1/2)
|
|
</code></pre></div>
|
|
<h3 id="api-fdmath-meanas.fdmath--maxwells-equations">Maxwell's Equations<a class="headerlink" href="#api-fdmath-meanas.fdmath--maxwells-equations" title="Permanent link">¶</a></h3>
|
|
<p>If we discretize both space (m,n,p) and time (l), Maxwell's equations become</p>
|
|
<p>$$ \begin{aligned}
|
|
\tilde{\nabla} \times \tilde{E}<em l-_frac_1="l-\frac{1">{l,\vec{r}} &= -\tilde{\partial}_t \hat{B}</em>
|
|
- \hat{M}}{2}, \vec{r} + \frac{1}{2}<em l-_frac_1="l-\frac{1">{l, \vec{r} + \frac{1}{2}} \
|
|
\hat{\nabla} \times \hat{H}</em>}{2},\vec{r} + \frac{1}{2}} &= \hat{\partial<em _vec_r="\vec{r" l_="l,">t \tilde{D}</em>
|
|
+ \tilde{J}}<em l-_frac_1="l-\frac{1">{l-\frac{1}{2},\vec{r}} \
|
|
\tilde{\nabla} \cdot \hat{B}</em> &= 0 \
|
|
\hat{\nabla} \cdot \tilde{D}}{2}, \vec{r} + \frac{1}{2}<em l_vec_r="l,\vec{r">{l,\vec{r}} &= \rho</em>
|
|
\end{aligned} $$}</p>
|
|
<p>with</p>
|
|
<p>$$ \begin{aligned}
|
|
\hat{B}<em _vec_r="\vec{r">{\vec{r}} &= \mu</em>} + \frac{1}{2}} \cdot \hat{H<em _vec_r="\vec{r">{\vec{r} + \frac{1}{2}} \
|
|
\tilde{D}</em>
|
|
\end{aligned} $$}} &= \epsilon_{\vec{r}} \cdot \tilde{E}_{\vec{r}</p>
|
|
<p>where the spatial subscripts are abbreviated as <span class="arithmatex">\(\vec{r} = (m, n, p)\)</span> and
|
|
<span class="arithmatex">\(\vec{r} + \frac{1}{2} = (m + \frac{1}{2}, n + \frac{1}{2}, p + \frac{1}{2})\)</span>,
|
|
<span class="arithmatex">\(\tilde{E}\)</span> and <span class="arithmatex">\(\hat{H}\)</span> are the electric and magnetic fields,
|
|
<span class="arithmatex">\(\tilde{J}\)</span> and <span class="arithmatex">\(\hat{M}\)</span> are the electric and magnetic current distributions,
|
|
and <span class="arithmatex">\(\epsilon\)</span> and <span class="arithmatex">\(\mu\)</span> are the dielectric permittivity and magnetic permeability.</p>
|
|
<p>The above is Yee's algorithm, written in a form analogous to Maxwell's equations.
|
|
The time derivatives can be expanded to form the update equations:</p>
|
|
<div class="highlight"><pre><span></span><code>[code: Maxwell's equations updates]
|
|
H[i, j, k] -= dt * (curl_forward(E)[i, j, k] + M[t, i, j, k]) / mu[i, j, k]
|
|
E[i, j, k] += dt * (curl_back( H)[i, j, k] + J[t, i, j, k]) / epsilon[i, j, k]
|
|
</code></pre></div>
|
|
<p>Note that the E-field fore-vector and H-field back-vector are offset by a half-cell, resulting
|
|
in distinct locations for all six E- and H-field components:</p>
|
|
<div class="highlight"><pre><span></span><code>[figure: Field components]
|
|
|
|
(m - 1/2,=> ____________Hx__________[H] <= r + 1/2 = (m + 1/2,
|
|
n + 1/2, /: /: /| n + 1/2,
|
|
z y p + 1/2) / : / : / | p + 1/2)
|
|
|/_x / : / : / |
|
|
/ : Ez__________Hy | Locations of the E- and
|
|
/ : : : /| | H-field components for the
|
|
(m - 1/2, / : : Ey...../.|..Hz [E] fore-vector at r = (m,n,p)
|
|
n - 1/2, =>/________________________/ | /| (the large cube's center)
|
|
p + 1/2) | : : / | | / | and [H] back-vector at r + 1/2
|
|
| : :/ | |/ | (the top right corner)
|
|
| : [E].......|.Ex |
|
|
| :.................|......| <= (m + 1/2, n + 1/2, p + 1/2)
|
|
| / | /
|
|
| / | /
|
|
| / | / This is the Yee discretization
|
|
| / | / scheme ("Yee cell").
|
|
r - 1/2 = | / | /
|
|
(m - 1/2, |/ |/
|
|
n - 1/2,=> |________________________| <= (m + 1/2, n - 1/2, p - 1/2)
|
|
p - 1/2)
|
|
</code></pre></div>
|
|
<p>Each component forms its own grid, offset from the others:</p>
|
|
<div class="highlight"><pre><span></span><code>[figure: E-fields for adjacent cells]
|
|
|
|
H1__________Hx0_________H0
|
|
z y /: /|
|
|
|/_x / : / | This figure shows H back-vector locations
|
|
/ : / | H0, H1, etc. and their associated components
|
|
Hy1 : Hy0 | H0 = (Hx0, Hy0, Hz0) etc.
|
|
/ : / |
|
|
/ Hz1 / Hz0
|
|
H2___________Hx3_________H3 | The equivalent drawing for E would have
|
|
| : | | fore-vectors located at the cube's
|
|
| : | | center (and the centers of adjacent cubes),
|
|
| : | | with components on the cube's faces.
|
|
| H5..........Hx4...|......H4
|
|
| / | /
|
|
Hz2 / Hz2 /
|
|
| / | /
|
|
| Hy6 | Hy4
|
|
| / | /
|
|
|/ |/
|
|
H6__________Hx7__________H7
|
|
</code></pre></div>
|
|
<p>The divergence equations can be derived by taking the divergence of the curl equations
|
|
and combining them with charge continuity,
|
|
$$ \hat{\nabla} \cdot \tilde{J} + \hat{\partial}_t \rho = 0 $$
|
|
implying that the discrete Maxwell's equations do not produce spurious charges.</p>
|
|
<h4 id="api-fdmath-meanas.fdmath--wave-equation">Wave equation<a class="headerlink" href="#api-fdmath-meanas.fdmath--wave-equation" title="Permanent link">¶</a></h4>
|
|
<p>Taking the backward curl of the <span class="arithmatex">\(\tilde{\nabla} \times \tilde{E}\)</span> equation and
|
|
replacing the resulting <span class="arithmatex">\(\hat{\nabla} \times \hat{H}\)</span> term using its respective equation,
|
|
and setting <span class="arithmatex">\(\hat{M}\)</span> to zero, we can form the discrete wave equation:</p>
|
|
<div class="arithmatex">\[
|
|
\begin{aligned}
|
|
\tilde{\nabla} \times \tilde{E}_{l,\vec{r}} &=
|
|
-\tilde{\partial}_t \hat{B}_{l-\frac{1}{2}, \vec{r} + \frac{1}{2}}
|
|
- \hat{M}_{l-1, \vec{r} + \frac{1}{2}} \\
|
|
\mu^{-1}_{\vec{r} + \frac{1}{2}} \cdot \tilde{\nabla} \times \tilde{E}_{l,\vec{r}} &=
|
|
-\tilde{\partial}_t \hat{H}_{l-\frac{1}{2}, \vec{r} + \frac{1}{2}} \\
|
|
\hat{\nabla} \times (\mu^{-1}_{\vec{r} + \frac{1}{2}} \cdot \tilde{\nabla} \times \tilde{E}_{l,\vec{r}}) &=
|
|
\hat{\nabla} \times (-\tilde{\partial}_t \hat{H}_{l-\frac{1}{2}, \vec{r} + \frac{1}{2}}) \\
|
|
\hat{\nabla} \times (\mu^{-1}_{\vec{r} + \frac{1}{2}} \cdot \tilde{\nabla} \times \tilde{E}_{l,\vec{r}}) &=
|
|
-\tilde{\partial}_t \hat{\nabla} \times \hat{H}_{l-\frac{1}{2}, \vec{r} + \frac{1}{2}} \\
|
|
\hat{\nabla} \times (\mu^{-1}_{\vec{r} + \frac{1}{2}} \cdot \tilde{\nabla} \times \tilde{E}_{l,\vec{r}}) &=
|
|
-\tilde{\partial}_t \hat{\partial}_t \epsilon_{\vec{r}} \tilde{E}_{l, \vec{r}} + \hat{\partial}_t \tilde{J}_{l-\frac{1}{2},\vec{r}} \\
|
|
\hat{\nabla} \times (\mu^{-1}_{\vec{r} + \frac{1}{2}} \cdot \tilde{\nabla} \times \tilde{E}_{l,\vec{r}})
|
|
+ \tilde{\partial}_t \hat{\partial}_t \epsilon_{\vec{r}} \cdot \tilde{E}_{l, \vec{r}}
|
|
&= \tilde{\partial}_t \tilde{J}_{l - \frac{1}{2}, \vec{r}}
|
|
\end{aligned}
|
|
\]</div>
|
|
<h4 id="api-fdmath-meanas.fdmath--frequency-domain">Frequency domain<a class="headerlink" href="#api-fdmath-meanas.fdmath--frequency-domain" title="Permanent link">¶</a></h4>
|
|
<p>We can substitute in a time-harmonic fields</p>
|
|
<div class="arithmatex">\[
|
|
\begin{aligned}
|
|
\tilde{E}_{l, \vec{r}} &= \tilde{E}_{\vec{r}} e^{-\imath \omega l \Delta_t} \\
|
|
\tilde{J}_{l, \vec{r}} &= \tilde{J}_{\vec{r}} e^{-\imath \omega (l - \frac{1}{2}) \Delta_t}
|
|
\end{aligned}
|
|
\]</div>
|
|
<p>resulting in</p>
|
|
<div class="arithmatex">\[
|
|
\begin{aligned}
|
|
\tilde{\partial}_t &\Rightarrow (e^{ \imath \omega \Delta_t} - 1) / \Delta_t = \frac{-2 \imath}{\Delta_t} \sin(\omega \Delta_t / 2) e^{-\imath \omega \Delta_t / 2} = -\imath \Omega e^{-\imath \omega \Delta_t / 2}\\
|
|
\hat{\partial}_t &\Rightarrow (1 - e^{-\imath \omega \Delta_t}) / \Delta_t = \frac{-2 \imath}{\Delta_t} \sin(\omega \Delta_t / 2) e^{ \imath \omega \Delta_t / 2} = -\imath \Omega e^{ \imath \omega \Delta_t / 2}\\
|
|
\Omega &= 2 \sin(\omega \Delta_t / 2) / \Delta_t
|
|
\end{aligned}
|
|
\]</div>
|
|
<p>This gives the frequency-domain wave equation,</p>
|
|
<div class="arithmatex">\[
|
|
\hat{\nabla} \times (\mu^{-1}_{\vec{r} + \frac{1}{2}} \cdot \tilde{\nabla} \times \tilde{E}_{\vec{r}})
|
|
-\Omega^2 \epsilon_{\vec{r}} \cdot \tilde{E}_{\vec{r}} = -\imath \Omega \tilde{J}_{\vec{r}} e^{\imath \omega \Delta_t / 2} \\
|
|
\]</div>
|
|
<h4 id="api-fdmath-meanas.fdmath--plane-waves-and-dispersion-relation">Plane waves and Dispersion relation<a class="headerlink" href="#api-fdmath-meanas.fdmath--plane-waves-and-dispersion-relation" title="Permanent link">¶</a></h4>
|
|
<p>With uniform material distribution and no sources</p>
|
|
<div class="arithmatex">\[
|
|
\begin{aligned}
|
|
\mu_{\vec{r} + \frac{1}{2}} &= \mu \\
|
|
\epsilon_{\vec{r}} &= \epsilon \\
|
|
\tilde{J}_{\vec{r}} &= 0 \\
|
|
\end{aligned}
|
|
\]</div>
|
|
<p>the frequency domain wave equation simplifies to</p>
|
|
<div class="arithmatex">\[ \hat{\nabla} \times \tilde{\nabla} \times \tilde{E}_{\vec{r}} - \Omega^2 \epsilon \mu \tilde{E}_{\vec{r}} = 0 \]</div>
|
|
<p>Since <span class="arithmatex">\(\hat{\nabla} \cdot \tilde{E}_{\vec{r}} = 0\)</span>, we can simplify</p>
|
|
<div class="arithmatex">\[
|
|
\begin{aligned}
|
|
\hat{\nabla} \times \tilde{\nabla} \times \tilde{E}_{\vec{r}}
|
|
&= \tilde{\nabla}(\hat{\nabla} \cdot \tilde{E}_{\vec{r}}) - \hat{\nabla} \cdot \tilde{\nabla} \tilde{E}_{\vec{r}} \\
|
|
&= - \hat{\nabla} \cdot \tilde{\nabla} \tilde{E}_{\vec{r}} \\
|
|
&= - \tilde{\nabla}^2 \tilde{E}_{\vec{r}}
|
|
\end{aligned}
|
|
\]</div>
|
|
<p>and we get</p>
|
|
<div class="arithmatex">\[ \tilde{\nabla}^2 \tilde{E}_{\vec{r}} + \Omega^2 \epsilon \mu \tilde{E}_{\vec{r}} = 0 \]</div>
|
|
<p>We can convert this to three scalar-wave equations of the form</p>
|
|
<div class="arithmatex">\[ (\tilde{\nabla}^2 + K^2) \phi_{\vec{r}} = 0 \]</div>
|
|
<p>with <span class="arithmatex">\(K^2 = \Omega^2 \mu \epsilon\)</span>. Now we let</p>
|
|
<div class="arithmatex">\[ \phi_{\vec{r}} = A e^{\imath (k_x m \Delta_x + k_y n \Delta_y + k_z p \Delta_z)} \]</div>
|
|
<p>resulting in</p>
|
|
<div class="arithmatex">\[
|
|
\begin{aligned}
|
|
\tilde{\partial}_x &\Rightarrow (e^{ \imath k_x \Delta_x} - 1) / \Delta_t = \frac{-2 \imath}{\Delta_x} \sin(k_x \Delta_x / 2) e^{ \imath k_x \Delta_x / 2} = \imath K_x e^{ \imath k_x \Delta_x / 2}\\
|
|
\hat{\partial}_x &\Rightarrow (1 - e^{-\imath k_x \Delta_x}) / \Delta_t = \frac{-2 \imath}{\Delta_x} \sin(k_x \Delta_x / 2) e^{-\imath k_x \Delta_x / 2} = \imath K_x e^{-\imath k_x \Delta_x / 2}\\
|
|
K_x &= 2 \sin(k_x \Delta_x / 2) / \Delta_x \\
|
|
\end{aligned}
|
|
\]</div>
|
|
<p>with similar expressions for the y and z dimnsions (and <span class="arithmatex">\(K_y, K_z\)</span>).</p>
|
|
<p>This implies</p>
|
|
<div class="arithmatex">\[
|
|
\tilde{\nabla}^2 = -(K_x^2 + K_y^2 + K_z^2) \phi_{\vec{r}} \\
|
|
K_x^2 + K_y^2 + K_z^2 = \Omega^2 \mu \epsilon = \Omega^2 / c^2
|
|
\]</div>
|
|
<p>where <span class="arithmatex">\(c = \sqrt{\mu \epsilon}\)</span>.</p>
|
|
<p>Assuming real <span class="arithmatex">\((k_x, k_y, k_z), \omega\)</span> will be real only if</p>
|
|
<div class="arithmatex">\[ c^2 \Delta_t^2 = \frac{\Delta_t^2}{\mu \epsilon} < 1/(\frac{1}{\Delta_x^2} + \frac{1}{\Delta_y^2} + \frac{1}{\Delta_z^2}) \]</div>
|
|
<p>If <span class="arithmatex">\(\Delta_x = \Delta_y = \Delta_z\)</span>, this simplifies to <span class="arithmatex">\(c \Delta_t < \Delta_x / \sqrt{3}\)</span>.
|
|
This last form can be interpreted as enforcing causality; the distance that light
|
|
travels in one timestep (i.e., <span class="arithmatex">\(c \Delta_t\)</span>) must be less than the diagonal
|
|
of the smallest cell ( <span class="arithmatex">\(\Delta_x / \sqrt{3}\)</span> when on a uniform cubic grid).</p>
|
|
<h3 id="api-fdmath-meanas.fdmath--grid-description">Grid description<a class="headerlink" href="#api-fdmath-meanas.fdmath--grid-description" title="Permanent link">¶</a></h3>
|
|
<p>As described in the section on scalar discrete derivatives above, cell widths
|
|
(<code>dx[i]</code>, <code>dy[j]</code>, <code>dz[k]</code>) along each axis can be arbitrary and independently
|
|
defined. Moreover, all field components are actually defined at "derived" or "dual"
|
|
positions, in-between the "base" grid points on one or more axes.</p>
|
|
<p>To get a better sense of how this works, let's start by drawing a grid with uniform
|
|
<code>dy</code> and <code>dz</code> and nonuniform <code>dx</code>. We will only draw one cell in the y and z dimensions
|
|
to make the illustration simpler; we need at least two cells in the x dimension to
|
|
demonstrate how nonuniform <code>dx</code> affects the various components.</p>
|
|
<p>Place the E fore-vectors at integer indices <span class="arithmatex">\(r = (m, n, p)\)</span> and the H back-vectors
|
|
at fractional indices <span class="arithmatex">\(r + \frac{1}{2} = (m + \frac{1}{2}, n + \frac{1}{2},
|
|
p + \frac{1}{2})\)</span>. Remember that these are indices and not coordinates; they can
|
|
correspond to arbitrary (monotonically increasing) coordinates depending on the cell widths.</p>
|
|
<p>Draw lines to denote the planes on which the H components and back-vectors are defined.
|
|
For simplicity, don't draw the equivalent planes for the E components and fore-vectors,
|
|
except as necessary to show their locations -- it's easiest to just connect them to their
|
|
associated H-equivalents.</p>
|
|
<p>The result looks something like this:</p>
|
|
<div class="highlight"><pre><span></span><code>[figure: Component centers]
|
|
p=
|
|
[H]__________Hx___________[H]_____Hx______[H] __ +1/2
|
|
z y /: /: /: /: /| | |
|
|
|/_x / : / : / : / : / | | |
|
|
/ : / : / : / : / | | |
|
|
Hy : Ez...........Hy : Ez......Hy | | |
|
|
/: : : : /: : : : /| | | |
|
|
/ : Hz : Ey....../.:..Hz : Ey./.|..Hz __ 0 | dz[0]
|
|
/ : /: : / / : /: : / / | /| | |
|
|
/_________________________/_______________/ | / | | |
|
|
| :/ : :/ | :/ : :/ | |/ | | |
|
|
| Ex : [E].......|..Ex : [E]..|..Ex | | |
|
|
| : | : | | | |
|
|
| [H]..........Hx....|......[H].....H|x.....[H] __ --------- (n=+1/2, p=-1/2)
|
|
| / | / | / / /
|
|
Hz / Hz / Hz / / /
|
|
| / | / | / / /
|
|
| Hy | Hy | Hy __ 0 / dy[0]
|
|
| / | / | / / /
|
|
| / | / | / / /
|
|
|/ |/ |/ / /
|
|
[H]__________Hx___________[H]_____Hx______[H] __ -1/2 /
|
|
=n
|
|
|------------|------------|-------|-------|
|
|
-1/2 0 +1/2 +1 +3/2 = m
|
|
|
|
------------------------- ----------------
|
|
dx[0] dx[1]
|
|
|
|
Part of a nonuniform "base grid", with labels specifying
|
|
positions of the various field components. [E] fore-vectors
|
|
are at the cell centers, and [H] back-vectors are at the
|
|
vertices. H components along the near (-y) top (+z) edge
|
|
have been omitted to make the insides of the cubes easier
|
|
to visualize.
|
|
</code></pre></div>
|
|
<p>The above figure shows where all the components are located; however, it is also useful to show
|
|
what volumes those components correspond to. Consider the Ex component at <code>m = +1/2</code>: it is
|
|
shifted in the x-direction by a half-cell from the E fore-vector at <code>m = 0</code> (labeled <code>[E]</code>
|
|
in the figure). It corresponds to a volume between <code>m = 0</code> and <code>m = +1</code> (the other
|
|
dimensions are not shifted, i.e. they are still bounded by <code>n, p = +-1/2</code>). (See figure
|
|
below). Since <code>m</code> is an index and not an x-coordinate, the Ex component is not necessarily
|
|
at the center of the volume it represents, and the x-length of its volume is the derived
|
|
quantity <code>dx'[0] = (dx[0] + dx[1]) / 2</code> rather than the base <code>dx</code>.
|
|
(See also <code>Scalar derivatives and cell shifts</code>).</p>
|
|
<div class="highlight"><pre><span></span><code>[figure: Ex volumes]
|
|
p=
|
|
<_________________________________________> __ +1/2
|
|
z y << /: / /: >> | |
|
|
|/_x < < / : / / : > > | |
|
|
< < / : / / : > > | |
|
|
< < / : / / : > > | |
|
|
<: < / : : / : >: > | |
|
|
< : < / : : / : > : > __ 0 | dz[0]
|
|
< : < / : : / :> : > | |
|
|
<____________/____________________/_______> : > | |
|
|
< : < | : : | > : > | |
|
|
< Ex < | : Ex | > Ex > | |
|
|
< : < | : : | > : > | |
|
|
< : <....|.......:........:...|.......>...:...> __ --------- (n=+1/2, p=-1/2)
|
|
< : < | / : /| /> : > / /
|
|
< : < | / : / | / > : > / /
|
|
< :< | / :/ | / > :> / /
|
|
< < | / : | / > > _ 0 / dy[0]
|
|
< < | / | / > > / /
|
|
< < | / | / > > / /
|
|
<< |/ |/ >> / /
|
|
<____________|____________________|_______> __ -1/2 /
|
|
=n
|
|
|------------|------------|-------|-------|
|
|
-1/2 0 +1/2 +1 +3/2 = m
|
|
|
|
~------------ -------------------- -------~
|
|
dx'[-1] dx'[0] dx'[1]
|
|
|
|
The Ex values are positioned on the x-faces of the base
|
|
grid. They represent the Ex field in volumes shifted by
|
|
a half-cell in the x-dimension, as shown here. Only the
|
|
center cell (with width dx'[0]) is fully shown; the
|
|
other two are truncated (shown using >< markers).
|
|
|
|
Note that the Ex positions are the in the same positions
|
|
as the previous figure; only the cell boundaries have moved.
|
|
Also note that the points at which Ex is defined are not
|
|
necessarily centered in the volumes they represent; non-
|
|
uniform cell sizes result in off-center volumes like the
|
|
center cell here.
|
|
</code></pre></div>
|
|
<p>The next figure shows the volumes corresponding to the Hy components, which
|
|
are shifted in two dimensions (x and z) compared to the base grid.</p>
|
|
<div class="highlight"><pre><span></span><code>[figure: Hy volumes]
|
|
p=
|
|
z y mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm __ +1/2 s
|
|
|/_x << m: m: >> | |
|
|
< < m : m : > > | | dz'[1]
|
|
< < m : m : > > | |
|
|
Hy........... m........Hy...........m......Hy > | |
|
|
< < m : m : > > | |
|
|
< ______ m_____:_______________m_____:_>______ __ 0
|
|
< < m /: m / > > | |
|
|
mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm > | |
|
|
< < | / : | / > > | | dz'[0]
|
|
< < | / : | / > > | |
|
|
< < | / : | / > > | |
|
|
< wwwww|w/wwwwwwwwwwwwwwwwwww|w/wwwww>wwwwwwww __ s
|
|
< < |/ w |/ w> > / /
|
|
_____________|_____________________|________ > / /
|
|
< < | w | w > > / /
|
|
< Hy........|...w........Hy.......|...w...>..Hy _ 0 / dy[0]
|
|
< < | w | w > > / /
|
|
<< | w | w > > / /
|
|
< |w |w >> / /
|
|
wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww __ -1/2 /
|
|
|
|
|------------|------------|--------|-------|
|
|
-1/2 0 +1/2 +1 +3/2 = m
|
|
|
|
~------------ --------------------- -------~
|
|
dx'[-1] dx'[0] dx'[1]
|
|
|
|
The Hy values are positioned on the y-edges of the base
|
|
grid. Again here, the 'Hy' labels represent the same points
|
|
as in the basic grid figure above; the edges have shifted
|
|
by a half-cell along the x- and z-axes.
|
|
|
|
The grid lines _|:/ are edges of the area represented by
|
|
each Hy value, and the lines drawn using <m>.w represent
|
|
edges where a cell's faces extend beyond the drawn area
|
|
(i.e. where the drawing is truncated in the x- or z-
|
|
directions).
|
|
</code></pre></div>
|
|
<h4 id="api-fdmath-meanas.fdmath--datastructure-dx_lists_t">Datastructure: dx_lists_t<a class="headerlink" href="#api-fdmath-meanas.fdmath--datastructure-dx_lists_t" title="Permanent link">¶</a></h4>
|
|
<p>In this documentation, the E fore-vectors are placed on the base grid. An
|
|
equivalent formulation could place the H back-vectors on the base grid instead.
|
|
However, in the case of a non-uniform grid, the operation to get from the "base"
|
|
cell widths to "derived" ones is not its own inverse.</p>
|
|
<p>The base grid's cell sizes could be fully described by a list of three 1D arrays,
|
|
specifying the cell widths along all three axes:</p>
|
|
<div class="highlight"><pre><span></span><code>[dx, dy, dz] = [[dx[0], dx[1], ...], [dy[0], ...], [dz[0], ...]]
|
|
</code></pre></div>
|
|
<p>Note that this is a list-of-arrays rather than a 2D array, as the simulation domain
|
|
may have a different number of cells along each axis.</p>
|
|
<p>Knowing the base grid's cell widths and the boundary conditions (periodic unless
|
|
otherwise noted) is enough information to calculate the cell widths <code>dx'</code>, <code>dy'</code>,
|
|
and <code>dz'</code> for the derived grids.</p>
|
|
<p>However, since most operations are trivially generalized to allow either E or H
|
|
to be defined on the base grid, they are written to take the a full set of base
|
|
and derived cell widths, distinguished by which field they apply to rather than
|
|
their "base" or "derived" status. This removes the need for each function to
|
|
generate the derived widths, and makes the "base" vs "derived" distinction
|
|
unnecessary in the code.</p>
|
|
<p>The resulting data structure containing all the cell widths takes the form of a
|
|
list-of-lists-of-arrays. The first list-of-arrays provides the cell widths for
|
|
the E-field fore-vectors, while the second list-of-arrays does the same for the
|
|
H-field back-vectors:</p>
|
|
<div class="highlight"><pre><span></span><code> [[[dx_e[0], dx_e[1], ...], [dy_e[0], ...], [dz_e[0], ...]],
|
|
[[dx_h[0], dx_h[1], ...], [dy_h[0], ...], [dz_h[0], ...]]]
|
|
</code></pre></div>
|
|
<p>where <code>dx_e[0]</code> is the x-width of the <code>m=0</code> cells, as used when calculating dE/dx,
|
|
and <code>dy_h[0]</code> is the y-width of the <code>n=0</code> cells, as used when calculating dH/dy, etc.</p>
|
|
<h3 id="api-fdmath-meanas.fdmath--permittivity-and-permeability">Permittivity and Permeability<a class="headerlink" href="#api-fdmath-meanas.fdmath--permittivity-and-permeability" title="Permanent link">¶</a></h3>
|
|
<p>Since each vector component of E and H is defined in a different location and represents
|
|
a different volume, the value of the spatially-discrete <code>epsilon</code> and <code>mu</code> can also be
|
|
different for all three field components, even when representing a simple planar interface
|
|
between two isotropic materials.</p>
|
|
<p>As a result, <code>epsilon</code> and <code>mu</code> are taken to have the same dimensions as the field, and
|
|
composed of the three diagonal tensor components:</p>
|
|
<div class="highlight"><pre><span></span><code>[equations: epsilon_and_mu]
|
|
epsilon = [epsilon_xx, epsilon_yy, epsilon_zz]
|
|
mu = [mu_xx, mu_yy, mu_zz]
|
|
</code></pre></div>
|
|
<p>or</p>
|
|
<div class="arithmatex">\[
|
|
\epsilon = \begin{bmatrix} \epsilon_{xx} & 0 & 0 \\
|
|
0 & \epsilon_{yy} & 0 \\
|
|
0 & 0 & \epsilon_{zz} \end{bmatrix}
|
|
$$
|
|
$$
|
|
\mu = \begin{bmatrix} \mu_{xx} & 0 & 0 \\
|
|
0 & \mu_{yy} & 0 \\
|
|
0 & 0 & \mu_{zz} \end{bmatrix}
|
|
\]</div>
|
|
<p>where the off-diagonal terms (e.g. <code>epsilon_xy</code>) are assumed to be zero.</p>
|
|
<p>High-accuracy volumetric integration of shapes on multiple grids can be performed
|
|
by the <a href="https://mpxd.net/code/jan/gridlock">gridlock</a> module.</p>
|
|
<p>The values of the vacuum permittivity and permability effectively become scaling
|
|
factors that appear in several locations (e.g. between the E and H fields). In
|
|
order to limit floating-point inaccuracy and simplify calculations, they are often
|
|
set to 1 and relative permittivities and permeabilities are used in their places;
|
|
the true values can be multiplied back in after the simulation is complete if non-
|
|
normalized results are needed.</p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="doc doc-children">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div><h2 id="functional-and-sparse-operators">Functional and sparse operators<a class="headerlink" href="#api-fdmath-functional-and-sparse-operators" title="Permanent link">¶</a></h2>
|
|
|
|
|
|
<div class="doc doc-object doc-module">
|
|
|
|
|
|
|
|
<h2 id="api-fdmath-meanas.fdmath.functional" class="doc doc-heading">
|
|
<code class="doc-symbol doc-symbol-heading doc-symbol-module"></code> <span class="doc doc-object-name doc-module-name">meanas.fdmath.functional</span>
|
|
|
|
|
|
<a href="#api-fdmath-meanas.fdmath.functional" class="headerlink" title="Permanent link">¶</a></h2>
|
|
|
|
<div class="doc doc-contents first">
|
|
|
|
<p>Math functions for finite difference simulations</p>
|
|
<p>Basic discrete calculus etc.</p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="doc doc-children">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="doc doc-object doc-function">
|
|
|
|
|
|
<h3 id="api-fdmath-meanas.fdmath.functional.deriv_forward" class="doc doc-heading">
|
|
<code class="doc-symbol doc-symbol-heading doc-symbol-function"></code> <span class="doc doc-object-name doc-function-name">deriv_forward</span>
|
|
|
|
|
|
<a href="#api-fdmath-meanas.fdmath.functional.deriv_forward" class="headerlink" title="Permanent link">¶</a></h3>
|
|
<div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#api-fdmath-__codelineno-0-1"></a><span class="nf">deriv_forward</span><span class="p">(</span>
|
|
<a id="__codelineno-0-2" name="__codelineno-0-2" href="#api-fdmath-__codelineno-0-2"></a> <span class="n">dx_e</span><span class="p">:</span> <span class="n">Sequence</span><span class="p">[</span><span class="n">NDArray</span><span class="p">[</span><span class="n">floating</span> <span class="o">|</span> <span class="n">complexfloating</span><span class="p">]]</span>
|
|
<a id="__codelineno-0-3" name="__codelineno-0-3" href="#api-fdmath-__codelineno-0-3"></a> <span class="o">|</span> <span class="kc">None</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
|
|
<a id="__codelineno-0-4" name="__codelineno-0-4" href="#api-fdmath-__codelineno-0-4"></a><span class="p">)</span> <span class="o">-></span> <span class="nb">tuple</span><span class="p">[</span>
|
|
<a id="__codelineno-0-5" name="__codelineno-0-5" href="#api-fdmath-__codelineno-0-5"></a> <span class="n">fdfield_updater_t</span><span class="p">,</span> <span class="n">fdfield_updater_t</span><span class="p">,</span> <span class="n">fdfield_updater_t</span>
|
|
<a id="__codelineno-0-6" name="__codelineno-0-6" href="#api-fdmath-__codelineno-0-6"></a><span class="p">]</span>
|
|
</code></pre></div>
|
|
|
|
<div class="doc doc-contents ">
|
|
|
|
<p>Utility operators for taking discretized derivatives (backward variant).</p>
|
|
|
|
|
|
<p><span class="doc-section-title">Parameters:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
<th>Default</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>dx_e</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title="collections.abc.Sequence" href="#collections.abc.Sequence">Sequence</a>[<a class="autorefs autorefs-internal" title="numpy.typing.NDArray" href="#numpy.typing.NDArray">NDArray</a>[<a class="autorefs autorefs-internal" title="numpy.floating" href="#numpy.floating">floating</a> | <a class="autorefs autorefs-internal" title="numpy.complexfloating" href="#numpy.complexfloating">complexfloating</a>]] | None</code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Lists of cell sizes for all axes
|
|
<code>[[dx_0, dx_1, ...], [dy_0, dy_1, ...], ...]</code>.</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<code>None</code>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
<p><span class="doc-section-title">Returns:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#tuple">tuple</a>[<a class="autorefs autorefs-internal" title=" fdfield_updater_t
|
|
|
|
|
|
|
|
module-attribute
|
|
(meanas.fdmath.types.fdfield_updater_t)" href="#api-fdmath-meanas.fdmath.types.fdfield_updater_t">fdfield_updater_t</a>, <a class="autorefs autorefs-internal" title=" fdfield_updater_t
|
|
|
|
|
|
|
|
module-attribute
|
|
(meanas.fdmath.types.fdfield_updater_t)" href="#api-fdmath-meanas.fdmath.types.fdfield_updater_t">fdfield_updater_t</a>, <a class="autorefs autorefs-internal" title=" fdfield_updater_t
|
|
|
|
|
|
|
|
module-attribute
|
|
(meanas.fdmath.types.fdfield_updater_t)" href="#api-fdmath-meanas.fdmath.types.fdfield_updater_t">fdfield_updater_t</a>]</code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>List of functions for taking forward derivatives along each axis.</p>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="doc doc-object doc-function">
|
|
|
|
|
|
<h3 id="api-fdmath-meanas.fdmath.functional.deriv_back" class="doc doc-heading">
|
|
<code class="doc-symbol doc-symbol-heading doc-symbol-function"></code> <span class="doc doc-object-name doc-function-name">deriv_back</span>
|
|
|
|
|
|
<a href="#api-fdmath-meanas.fdmath.functional.deriv_back" class="headerlink" title="Permanent link">¶</a></h3>
|
|
<div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#api-fdmath-__codelineno-0-1"></a><span class="nf">deriv_back</span><span class="p">(</span>
|
|
<a id="__codelineno-0-2" name="__codelineno-0-2" href="#api-fdmath-__codelineno-0-2"></a> <span class="n">dx_h</span><span class="p">:</span> <span class="n">Sequence</span><span class="p">[</span><span class="n">NDArray</span><span class="p">[</span><span class="n">floating</span> <span class="o">|</span> <span class="n">complexfloating</span><span class="p">]]</span>
|
|
<a id="__codelineno-0-3" name="__codelineno-0-3" href="#api-fdmath-__codelineno-0-3"></a> <span class="o">|</span> <span class="kc">None</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
|
|
<a id="__codelineno-0-4" name="__codelineno-0-4" href="#api-fdmath-__codelineno-0-4"></a><span class="p">)</span> <span class="o">-></span> <span class="nb">tuple</span><span class="p">[</span>
|
|
<a id="__codelineno-0-5" name="__codelineno-0-5" href="#api-fdmath-__codelineno-0-5"></a> <span class="n">fdfield_updater_t</span><span class="p">,</span> <span class="n">fdfield_updater_t</span><span class="p">,</span> <span class="n">fdfield_updater_t</span>
|
|
<a id="__codelineno-0-6" name="__codelineno-0-6" href="#api-fdmath-__codelineno-0-6"></a><span class="p">]</span>
|
|
</code></pre></div>
|
|
|
|
<div class="doc doc-contents ">
|
|
|
|
<p>Utility operators for taking discretized derivatives (forward variant).</p>
|
|
|
|
|
|
<p><span class="doc-section-title">Parameters:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
<th>Default</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>dx_h</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title="collections.abc.Sequence" href="#collections.abc.Sequence">Sequence</a>[<a class="autorefs autorefs-internal" title="numpy.typing.NDArray" href="#numpy.typing.NDArray">NDArray</a>[<a class="autorefs autorefs-internal" title="numpy.floating" href="#numpy.floating">floating</a> | <a class="autorefs autorefs-internal" title="numpy.complexfloating" href="#numpy.complexfloating">complexfloating</a>]] | None</code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Lists of cell sizes for all axes
|
|
<code>[[dx_0, dx_1, ...], [dy_0, dy_1, ...], ...]</code>.</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<code>None</code>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
<p><span class="doc-section-title">Returns:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#tuple">tuple</a>[<a class="autorefs autorefs-internal" title=" fdfield_updater_t
|
|
|
|
|
|
|
|
module-attribute
|
|
(meanas.fdmath.types.fdfield_updater_t)" href="#api-fdmath-meanas.fdmath.types.fdfield_updater_t">fdfield_updater_t</a>, <a class="autorefs autorefs-internal" title=" fdfield_updater_t
|
|
|
|
|
|
|
|
module-attribute
|
|
(meanas.fdmath.types.fdfield_updater_t)" href="#api-fdmath-meanas.fdmath.types.fdfield_updater_t">fdfield_updater_t</a>, <a class="autorefs autorefs-internal" title=" fdfield_updater_t
|
|
|
|
|
|
|
|
module-attribute
|
|
(meanas.fdmath.types.fdfield_updater_t)" href="#api-fdmath-meanas.fdmath.types.fdfield_updater_t">fdfield_updater_t</a>]</code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>List of functions for taking forward derivatives along each axis.</p>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="doc doc-object doc-function">
|
|
|
|
|
|
<h3 id="api-fdmath-meanas.fdmath.functional.curl_forward" class="doc doc-heading">
|
|
<code class="doc-symbol doc-symbol-heading doc-symbol-function"></code> <span class="doc doc-object-name doc-function-name">curl_forward</span>
|
|
|
|
|
|
<a href="#api-fdmath-meanas.fdmath.functional.curl_forward" class="headerlink" title="Permanent link">¶</a></h3>
|
|
<div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#api-fdmath-__codelineno-0-1"></a><span class="nf">curl_forward</span><span class="p">(</span>
|
|
<a id="__codelineno-0-2" name="__codelineno-0-2" href="#api-fdmath-__codelineno-0-2"></a> <span class="n">dx_e</span><span class="p">:</span> <span class="n">Sequence</span><span class="p">[</span><span class="n">NDArray</span><span class="p">[</span><span class="n">floating</span> <span class="o">|</span> <span class="n">complexfloating</span><span class="p">]]</span>
|
|
<a id="__codelineno-0-3" name="__codelineno-0-3" href="#api-fdmath-__codelineno-0-3"></a> <span class="o">|</span> <span class="kc">None</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
|
|
<a id="__codelineno-0-4" name="__codelineno-0-4" href="#api-fdmath-__codelineno-0-4"></a><span class="p">)</span> <span class="o">-></span> <span class="n">Callable</span><span class="p">[[</span><span class="n">TT</span><span class="p">],</span> <span class="n">TT</span><span class="p">]</span>
|
|
</code></pre></div>
|
|
|
|
<div class="doc doc-contents ">
|
|
|
|
<p>Curl operator for use with the E field.</p>
|
|
|
|
|
|
<p><span class="doc-section-title">Parameters:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
<th>Default</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>dx_e</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title="collections.abc.Sequence" href="#collections.abc.Sequence">Sequence</a>[<a class="autorefs autorefs-internal" title="numpy.typing.NDArray" href="#numpy.typing.NDArray">NDArray</a>[<a class="autorefs autorefs-internal" title="numpy.floating" href="#numpy.floating">floating</a> | <a class="autorefs autorefs-internal" title="numpy.complexfloating" href="#numpy.complexfloating">complexfloating</a>]] | None</code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Lists of cell sizes for all axes
|
|
<code>[[dx_0, dx_1, ...], [dy_0, dy_1, ...], ...]</code>.</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<code>None</code>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
<p><span class="doc-section-title">Returns:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title="collections.abc.Callable" href="#collections.abc.Callable">Callable</a>[[<a class="autorefs autorefs-internal" title="meanas.fdmath.functional.TT" href="#meanas.fdmath.functional.TT">TT</a>], <a class="autorefs autorefs-internal" title="meanas.fdmath.functional.TT" href="#meanas.fdmath.functional.TT">TT</a>]</code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Function <code>f</code> for taking the discrete forward curl of a field,</p>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title="collections.abc.Callable" href="#collections.abc.Callable">Callable</a>[[<a class="autorefs autorefs-internal" title="meanas.fdmath.functional.TT" href="#meanas.fdmath.functional.TT">TT</a>], <a class="autorefs autorefs-internal" title="meanas.fdmath.functional.TT" href="#meanas.fdmath.functional.TT">TT</a>]</code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p><code>f(E)</code> -> curlE <span class="arithmatex">\(= \nabla_f \times E\)</span></p>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="doc doc-object doc-function">
|
|
|
|
|
|
<h3 id="api-fdmath-meanas.fdmath.functional.curl_back" class="doc doc-heading">
|
|
<code class="doc-symbol doc-symbol-heading doc-symbol-function"></code> <span class="doc doc-object-name doc-function-name">curl_back</span>
|
|
|
|
|
|
<a href="#api-fdmath-meanas.fdmath.functional.curl_back" class="headerlink" title="Permanent link">¶</a></h3>
|
|
<div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#api-fdmath-__codelineno-0-1"></a><span class="nf">curl_back</span><span class="p">(</span>
|
|
<a id="__codelineno-0-2" name="__codelineno-0-2" href="#api-fdmath-__codelineno-0-2"></a> <span class="n">dx_h</span><span class="p">:</span> <span class="n">Sequence</span><span class="p">[</span><span class="n">NDArray</span><span class="p">[</span><span class="n">floating</span> <span class="o">|</span> <span class="n">complexfloating</span><span class="p">]]</span>
|
|
<a id="__codelineno-0-3" name="__codelineno-0-3" href="#api-fdmath-__codelineno-0-3"></a> <span class="o">|</span> <span class="kc">None</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
|
|
<a id="__codelineno-0-4" name="__codelineno-0-4" href="#api-fdmath-__codelineno-0-4"></a><span class="p">)</span> <span class="o">-></span> <span class="n">Callable</span><span class="p">[[</span><span class="n">TT</span><span class="p">],</span> <span class="n">TT</span><span class="p">]</span>
|
|
</code></pre></div>
|
|
|
|
<div class="doc doc-contents ">
|
|
|
|
<p>Create a function which takes the backward curl of a field.</p>
|
|
|
|
|
|
<p><span class="doc-section-title">Parameters:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
<th>Default</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>dx_h</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title="collections.abc.Sequence" href="#collections.abc.Sequence">Sequence</a>[<a class="autorefs autorefs-internal" title="numpy.typing.NDArray" href="#numpy.typing.NDArray">NDArray</a>[<a class="autorefs autorefs-internal" title="numpy.floating" href="#numpy.floating">floating</a> | <a class="autorefs autorefs-internal" title="numpy.complexfloating" href="#numpy.complexfloating">complexfloating</a>]] | None</code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Lists of cell sizes for all axes
|
|
<code>[[dx_0, dx_1, ...], [dy_0, dy_1, ...], ...]</code>.</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<code>None</code>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
<p><span class="doc-section-title">Returns:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title="collections.abc.Callable" href="#collections.abc.Callable">Callable</a>[[<a class="autorefs autorefs-internal" title="meanas.fdmath.functional.TT" href="#meanas.fdmath.functional.TT">TT</a>], <a class="autorefs autorefs-internal" title="meanas.fdmath.functional.TT" href="#meanas.fdmath.functional.TT">TT</a>]</code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Function <code>f</code> for taking the discrete backward curl of a field,</p>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title="collections.abc.Callable" href="#collections.abc.Callable">Callable</a>[[<a class="autorefs autorefs-internal" title="meanas.fdmath.functional.TT" href="#meanas.fdmath.functional.TT">TT</a>], <a class="autorefs autorefs-internal" title="meanas.fdmath.functional.TT" href="#meanas.fdmath.functional.TT">TT</a>]</code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p><code>f(H)</code> -> curlH <span class="arithmatex">\(= \nabla_b \times H\)</span></p>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="doc doc-object doc-module">
|
|
|
|
|
|
|
|
<h2 id="api-fdmath-meanas.fdmath.operators" class="doc doc-heading">
|
|
<code class="doc-symbol doc-symbol-heading doc-symbol-module"></code> <span class="doc doc-object-name doc-module-name">meanas.fdmath.operators</span>
|
|
|
|
|
|
<a href="#api-fdmath-meanas.fdmath.operators" class="headerlink" title="Permanent link">¶</a></h2>
|
|
|
|
<div class="doc doc-contents first">
|
|
|
|
<p>Matrix operators for finite difference simulations</p>
|
|
<p>Basic discrete calculus etc.</p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="doc doc-children">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="doc doc-object doc-function">
|
|
|
|
|
|
<h3 id="api-fdmath-meanas.fdmath.operators.shift_circ" class="doc doc-heading">
|
|
<code class="doc-symbol doc-symbol-heading doc-symbol-function"></code> <span class="doc doc-object-name doc-function-name">shift_circ</span>
|
|
|
|
|
|
<a href="#api-fdmath-meanas.fdmath.operators.shift_circ" class="headerlink" title="Permanent link">¶</a></h3>
|
|
<div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#api-fdmath-__codelineno-0-1"></a><span class="nf">shift_circ</span><span class="p">(</span>
|
|
<a id="__codelineno-0-2" name="__codelineno-0-2" href="#api-fdmath-__codelineno-0-2"></a> <span class="n">axis</span><span class="p">:</span> <span class="nb">int</span><span class="p">,</span> <span class="n">shape</span><span class="p">:</span> <span class="n">Sequence</span><span class="p">[</span><span class="nb">int</span><span class="p">],</span> <span class="n">shift_distance</span><span class="p">:</span> <span class="nb">int</span> <span class="o">=</span> <span class="mi">1</span>
|
|
<a id="__codelineno-0-3" name="__codelineno-0-3" href="#api-fdmath-__codelineno-0-3"></a><span class="p">)</span> <span class="o">-></span> <span class="n">sparse</span><span class="o">.</span><span class="n">sparray</span>
|
|
</code></pre></div>
|
|
|
|
<div class="doc doc-contents ">
|
|
|
|
<p>Utility operator for performing a circular shift along a specified axis by a
|
|
specified number of elements.</p>
|
|
|
|
|
|
<p><span class="doc-section-title">Parameters:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
<th>Default</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>axis</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#index-recommended-starting-points">int</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Axis to shift along. x=0, y=1, z=2</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>shape</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title="collections.abc.Sequence" href="#collections.abc.Sequence">Sequence</a>[<a class="autorefs autorefs-internal" href="#index-recommended-starting-points">int</a>]</code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Shape of the grid being shifted</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>shift_distance</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#index-recommended-starting-points">int</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Number of cells to shift by. May be negative. Default 1.</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<code>1</code>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
<p><span class="doc-section-title">Returns:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title="scipy.sparse.sparray" href="#scipy.sparse.sparray">sparray</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Sparse matrix for performing the circular shift.</p>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="doc doc-object doc-function">
|
|
|
|
|
|
<h3 id="api-fdmath-meanas.fdmath.operators.shift_with_mirror" class="doc doc-heading">
|
|
<code class="doc-symbol doc-symbol-heading doc-symbol-function"></code> <span class="doc doc-object-name doc-function-name">shift_with_mirror</span>
|
|
|
|
|
|
<a href="#api-fdmath-meanas.fdmath.operators.shift_with_mirror" class="headerlink" title="Permanent link">¶</a></h3>
|
|
<div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#api-fdmath-__codelineno-0-1"></a><span class="nf">shift_with_mirror</span><span class="p">(</span>
|
|
<a id="__codelineno-0-2" name="__codelineno-0-2" href="#api-fdmath-__codelineno-0-2"></a> <span class="n">axis</span><span class="p">:</span> <span class="nb">int</span><span class="p">,</span> <span class="n">shape</span><span class="p">:</span> <span class="n">Sequence</span><span class="p">[</span><span class="nb">int</span><span class="p">],</span> <span class="n">shift_distance</span><span class="p">:</span> <span class="nb">int</span> <span class="o">=</span> <span class="mi">1</span>
|
|
<a id="__codelineno-0-3" name="__codelineno-0-3" href="#api-fdmath-__codelineno-0-3"></a><span class="p">)</span> <span class="o">-></span> <span class="n">sparse</span><span class="o">.</span><span class="n">sparray</span>
|
|
</code></pre></div>
|
|
|
|
<div class="doc doc-contents ">
|
|
|
|
<p>Utility operator for performing an n-element shift along a specified axis, with mirror
|
|
boundary conditions applied to the cells beyond the receding edge.</p>
|
|
|
|
|
|
<p><span class="doc-section-title">Parameters:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
<th>Default</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>axis</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#index-recommended-starting-points">int</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Axis to shift along. x=0, y=1, z=2</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>shape</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title="collections.abc.Sequence" href="#collections.abc.Sequence">Sequence</a>[<a class="autorefs autorefs-internal" href="#index-recommended-starting-points">int</a>]</code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Shape of the grid being shifted</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>shift_distance</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#index-recommended-starting-points">int</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Number of cells to shift by. May be negative. Default 1.</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<code>1</code>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
<p><span class="doc-section-title">Returns:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title="scipy.sparse.sparray" href="#scipy.sparse.sparray">sparray</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Sparse matrix for performing the shift-with-mirror.</p>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="doc doc-object doc-function">
|
|
|
|
|
|
<h3 id="api-fdmath-meanas.fdmath.operators.deriv_forward" class="doc doc-heading">
|
|
<code class="doc-symbol doc-symbol-heading doc-symbol-function"></code> <span class="doc doc-object-name doc-function-name">deriv_forward</span>
|
|
|
|
|
|
<a href="#api-fdmath-meanas.fdmath.operators.deriv_forward" class="headerlink" title="Permanent link">¶</a></h3>
|
|
<div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#api-fdmath-__codelineno-0-1"></a><span class="nf">deriv_forward</span><span class="p">(</span>
|
|
<a id="__codelineno-0-2" name="__codelineno-0-2" href="#api-fdmath-__codelineno-0-2"></a> <span class="n">dx_e</span><span class="p">:</span> <span class="n">Sequence</span><span class="p">[</span><span class="n">NDArray</span><span class="p">[</span><span class="n">floating</span> <span class="o">|</span> <span class="n">complexfloating</span><span class="p">]],</span>
|
|
<a id="__codelineno-0-3" name="__codelineno-0-3" href="#api-fdmath-__codelineno-0-3"></a><span class="p">)</span> <span class="o">-></span> <span class="nb">list</span><span class="p">[</span><span class="n">sparse</span><span class="o">.</span><span class="n">sparray</span><span class="p">]</span>
|
|
</code></pre></div>
|
|
|
|
<div class="doc doc-contents ">
|
|
|
|
<p>Utility operators for taking discretized derivatives (forward variant).</p>
|
|
|
|
|
|
<p><span class="doc-section-title">Parameters:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
<th>Default</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>dx_e</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title="collections.abc.Sequence" href="#collections.abc.Sequence">Sequence</a>[<a class="autorefs autorefs-internal" title="numpy.typing.NDArray" href="#numpy.typing.NDArray">NDArray</a>[<a class="autorefs autorefs-internal" title="numpy.floating" href="#numpy.floating">floating</a> | <a class="autorefs autorefs-internal" title="numpy.complexfloating" href="#numpy.complexfloating">complexfloating</a>]]</code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Lists of cell sizes for all axes
|
|
<code>[[dx_0, dx_1, ...], [dy_0, dy_1, ...], ...]</code>.</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
<p><span class="doc-section-title">Returns:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#api-fdmath-meanas.fdmath.types.dx_lists_mut">list</a>[<a class="autorefs autorefs-internal" title="scipy.sparse.sparray" href="#scipy.sparse.sparray">sparray</a>]</code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>List of operators for taking forward derivatives along each axis.</p>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="doc doc-object doc-function">
|
|
|
|
|
|
<h3 id="api-fdmath-meanas.fdmath.operators.deriv_back" class="doc doc-heading">
|
|
<code class="doc-symbol doc-symbol-heading doc-symbol-function"></code> <span class="doc doc-object-name doc-function-name">deriv_back</span>
|
|
|
|
|
|
<a href="#api-fdmath-meanas.fdmath.operators.deriv_back" class="headerlink" title="Permanent link">¶</a></h3>
|
|
<div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#api-fdmath-__codelineno-0-1"></a><span class="nf">deriv_back</span><span class="p">(</span>
|
|
<a id="__codelineno-0-2" name="__codelineno-0-2" href="#api-fdmath-__codelineno-0-2"></a> <span class="n">dx_h</span><span class="p">:</span> <span class="n">Sequence</span><span class="p">[</span><span class="n">NDArray</span><span class="p">[</span><span class="n">floating</span> <span class="o">|</span> <span class="n">complexfloating</span><span class="p">]],</span>
|
|
<a id="__codelineno-0-3" name="__codelineno-0-3" href="#api-fdmath-__codelineno-0-3"></a><span class="p">)</span> <span class="o">-></span> <span class="nb">list</span><span class="p">[</span><span class="n">sparse</span><span class="o">.</span><span class="n">sparray</span><span class="p">]</span>
|
|
</code></pre></div>
|
|
|
|
<div class="doc doc-contents ">
|
|
|
|
<p>Utility operators for taking discretized derivatives (backward variant).</p>
|
|
|
|
|
|
<p><span class="doc-section-title">Parameters:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
<th>Default</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>dx_h</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title="collections.abc.Sequence" href="#collections.abc.Sequence">Sequence</a>[<a class="autorefs autorefs-internal" title="numpy.typing.NDArray" href="#numpy.typing.NDArray">NDArray</a>[<a class="autorefs autorefs-internal" title="numpy.floating" href="#numpy.floating">floating</a> | <a class="autorefs autorefs-internal" title="numpy.complexfloating" href="#numpy.complexfloating">complexfloating</a>]]</code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Lists of cell sizes for all axes
|
|
<code>[[dx_0, dx_1, ...], [dy_0, dy_1, ...], ...]</code>.</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
<p><span class="doc-section-title">Returns:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#api-fdmath-meanas.fdmath.types.dx_lists_mut">list</a>[<a class="autorefs autorefs-internal" title="scipy.sparse.sparray" href="#scipy.sparse.sparray">sparray</a>]</code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>List of operators for taking forward derivatives along each axis.</p>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="doc doc-object doc-function">
|
|
|
|
|
|
<h3 id="api-fdmath-meanas.fdmath.operators.cross" class="doc doc-heading">
|
|
<code class="doc-symbol doc-symbol-heading doc-symbol-function"></code> <span class="doc doc-object-name doc-function-name">cross</span>
|
|
|
|
|
|
<a href="#api-fdmath-meanas.fdmath.operators.cross" class="headerlink" title="Permanent link">¶</a></h3>
|
|
<div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#api-fdmath-__codelineno-0-1"></a><span class="nf">cross</span><span class="p">(</span><span class="n">B</span><span class="p">:</span> <span class="n">Sequence</span><span class="p">[</span><span class="n">sparray</span><span class="p">])</span> <span class="o">-></span> <span class="n">sparse</span><span class="o">.</span><span class="n">sparray</span>
|
|
</code></pre></div>
|
|
|
|
<div class="doc doc-contents ">
|
|
|
|
<p>Cross product operator</p>
|
|
|
|
|
|
<p><span class="doc-section-title">Parameters:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
<th>Default</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>B</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title="collections.abc.Sequence" href="#collections.abc.Sequence">Sequence</a>[<a class="autorefs autorefs-internal" title="scipy.sparse.sparray" href="#scipy.sparse.sparray">sparray</a>]</code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>List <code>[Bx, By, Bz]</code> of sparse matrices corresponding to the x, y, z
|
|
portions of the operator on the left side of the cross product.</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
<p><span class="doc-section-title">Returns:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title="scipy.sparse.sparray" href="#scipy.sparse.sparray">sparray</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Sparse matrix corresponding to (B x), where x is the cross product.</p>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="doc doc-object doc-function">
|
|
|
|
|
|
<h3 id="api-fdmath-meanas.fdmath.operators.vec_cross" class="doc doc-heading">
|
|
<code class="doc-symbol doc-symbol-heading doc-symbol-function"></code> <span class="doc doc-object-name doc-function-name">vec_cross</span>
|
|
|
|
|
|
<a href="#api-fdmath-meanas.fdmath.operators.vec_cross" class="headerlink" title="Permanent link">¶</a></h3>
|
|
<div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#api-fdmath-__codelineno-0-1"></a><span class="nf">vec_cross</span><span class="p">(</span><span class="n">b</span><span class="p">:</span> <span class="n">vfdfield_t</span><span class="p">)</span> <span class="o">-></span> <span class="n">sparse</span><span class="o">.</span><span class="n">sparray</span>
|
|
</code></pre></div>
|
|
|
|
<div class="doc doc-contents ">
|
|
|
|
<p>Vector cross product operator</p>
|
|
|
|
|
|
<p><span class="doc-section-title">Parameters:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
<th>Default</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>b</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title="meanas.fdmath.types.vfdfield_t" href="#meanas.fdmath.types.vfdfield_t">vfdfield_t</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Vector on the left side of the cross product.</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<p>Returns:</p>
|
|
<div class="highlight"><pre><span></span><code>Sparse matrix corresponding to (b x), where x is the cross product.
|
|
</code></pre></div>
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="doc doc-object doc-function">
|
|
|
|
|
|
<h3 id="api-fdmath-meanas.fdmath.operators.avg_forward" class="doc doc-heading">
|
|
<code class="doc-symbol doc-symbol-heading doc-symbol-function"></code> <span class="doc doc-object-name doc-function-name">avg_forward</span>
|
|
|
|
|
|
<a href="#api-fdmath-meanas.fdmath.operators.avg_forward" class="headerlink" title="Permanent link">¶</a></h3>
|
|
<div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#api-fdmath-__codelineno-0-1"></a><span class="nf">avg_forward</span><span class="p">(</span>
|
|
<a id="__codelineno-0-2" name="__codelineno-0-2" href="#api-fdmath-__codelineno-0-2"></a> <span class="n">axis</span><span class="p">:</span> <span class="nb">int</span><span class="p">,</span> <span class="n">shape</span><span class="p">:</span> <span class="n">Sequence</span><span class="p">[</span><span class="nb">int</span><span class="p">]</span>
|
|
<a id="__codelineno-0-3" name="__codelineno-0-3" href="#api-fdmath-__codelineno-0-3"></a><span class="p">)</span> <span class="o">-></span> <span class="n">sparse</span><span class="o">.</span><span class="n">sparray</span>
|
|
</code></pre></div>
|
|
|
|
<div class="doc doc-contents ">
|
|
|
|
<p>Forward average operator <code>(x4 = (x4 + x5) / 2)</code></p>
|
|
|
|
|
|
<p><span class="doc-section-title">Parameters:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
<th>Default</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>axis</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#index-recommended-starting-points">int</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Axis to average along (x=0, y=1, z=2)</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>shape</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title="collections.abc.Sequence" href="#collections.abc.Sequence">Sequence</a>[<a class="autorefs autorefs-internal" href="#index-recommended-starting-points">int</a>]</code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Shape of the grid to average</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
<p><span class="doc-section-title">Returns:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title="scipy.sparse.sparray" href="#scipy.sparse.sparray">sparray</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Sparse matrix for forward average operation.</p>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="doc doc-object doc-function">
|
|
|
|
|
|
<h3 id="api-fdmath-meanas.fdmath.operators.avg_back" class="doc doc-heading">
|
|
<code class="doc-symbol doc-symbol-heading doc-symbol-function"></code> <span class="doc doc-object-name doc-function-name">avg_back</span>
|
|
|
|
|
|
<a href="#api-fdmath-meanas.fdmath.operators.avg_back" class="headerlink" title="Permanent link">¶</a></h3>
|
|
<div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#api-fdmath-__codelineno-0-1"></a><span class="nf">avg_back</span><span class="p">(</span><span class="n">axis</span><span class="p">:</span> <span class="nb">int</span><span class="p">,</span> <span class="n">shape</span><span class="p">:</span> <span class="n">Sequence</span><span class="p">[</span><span class="nb">int</span><span class="p">])</span> <span class="o">-></span> <span class="n">sparse</span><span class="o">.</span><span class="n">sparray</span>
|
|
</code></pre></div>
|
|
|
|
<div class="doc doc-contents ">
|
|
|
|
<p>Backward average operator <code>(x4 = (x4 + x3) / 2)</code></p>
|
|
|
|
|
|
<p><span class="doc-section-title">Parameters:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
<th>Default</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>axis</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#index-recommended-starting-points">int</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Axis to average along (x=0, y=1, z=2)</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>shape</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title="collections.abc.Sequence" href="#collections.abc.Sequence">Sequence</a>[<a class="autorefs autorefs-internal" href="#index-recommended-starting-points">int</a>]</code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Shape of the grid to average</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
<p><span class="doc-section-title">Returns:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title="scipy.sparse.sparray" href="#scipy.sparse.sparray">sparray</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Sparse matrix for backward average operation.</p>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="doc doc-object doc-function">
|
|
|
|
|
|
<h3 id="api-fdmath-meanas.fdmath.operators.curl_forward" class="doc doc-heading">
|
|
<code class="doc-symbol doc-symbol-heading doc-symbol-function"></code> <span class="doc doc-object-name doc-function-name">curl_forward</span>
|
|
|
|
|
|
<a href="#api-fdmath-meanas.fdmath.operators.curl_forward" class="headerlink" title="Permanent link">¶</a></h3>
|
|
<div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#api-fdmath-__codelineno-0-1"></a><span class="nf">curl_forward</span><span class="p">(</span>
|
|
<a id="__codelineno-0-2" name="__codelineno-0-2" href="#api-fdmath-__codelineno-0-2"></a> <span class="n">dx_e</span><span class="p">:</span> <span class="n">Sequence</span><span class="p">[</span><span class="n">NDArray</span><span class="p">[</span><span class="n">floating</span> <span class="o">|</span> <span class="n">complexfloating</span><span class="p">]],</span>
|
|
<a id="__codelineno-0-3" name="__codelineno-0-3" href="#api-fdmath-__codelineno-0-3"></a><span class="p">)</span> <span class="o">-></span> <span class="n">sparse</span><span class="o">.</span><span class="n">sparray</span>
|
|
</code></pre></div>
|
|
|
|
<div class="doc doc-contents ">
|
|
|
|
<p>Curl operator for use with the E field.</p>
|
|
|
|
|
|
<p><span class="doc-section-title">Parameters:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
<th>Default</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>dx_e</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title="collections.abc.Sequence" href="#collections.abc.Sequence">Sequence</a>[<a class="autorefs autorefs-internal" title="numpy.typing.NDArray" href="#numpy.typing.NDArray">NDArray</a>[<a class="autorefs autorefs-internal" title="numpy.floating" href="#numpy.floating">floating</a> | <a class="autorefs autorefs-internal" title="numpy.complexfloating" href="#numpy.complexfloating">complexfloating</a>]]</code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Lists of cell sizes for all axes
|
|
<code>[[dx_0, dx_1, ...], [dy_0, dy_1, ...], ...]</code>.</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
<p><span class="doc-section-title">Returns:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title="scipy.sparse.sparray" href="#scipy.sparse.sparray">sparray</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Sparse matrix for taking the discretized curl of the E-field</p>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="doc doc-object doc-function">
|
|
|
|
|
|
<h3 id="api-fdmath-meanas.fdmath.operators.curl_back" class="doc doc-heading">
|
|
<code class="doc-symbol doc-symbol-heading doc-symbol-function"></code> <span class="doc doc-object-name doc-function-name">curl_back</span>
|
|
|
|
|
|
<a href="#api-fdmath-meanas.fdmath.operators.curl_back" class="headerlink" title="Permanent link">¶</a></h3>
|
|
<div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#api-fdmath-__codelineno-0-1"></a><span class="nf">curl_back</span><span class="p">(</span>
|
|
<a id="__codelineno-0-2" name="__codelineno-0-2" href="#api-fdmath-__codelineno-0-2"></a> <span class="n">dx_h</span><span class="p">:</span> <span class="n">Sequence</span><span class="p">[</span><span class="n">NDArray</span><span class="p">[</span><span class="n">floating</span> <span class="o">|</span> <span class="n">complexfloating</span><span class="p">]],</span>
|
|
<a id="__codelineno-0-3" name="__codelineno-0-3" href="#api-fdmath-__codelineno-0-3"></a><span class="p">)</span> <span class="o">-></span> <span class="n">sparse</span><span class="o">.</span><span class="n">sparray</span>
|
|
</code></pre></div>
|
|
|
|
<div class="doc doc-contents ">
|
|
|
|
<p>Curl operator for use with the H field.</p>
|
|
|
|
|
|
<p><span class="doc-section-title">Parameters:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
<th>Default</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>dx_h</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title="collections.abc.Sequence" href="#collections.abc.Sequence">Sequence</a>[<a class="autorefs autorefs-internal" title="numpy.typing.NDArray" href="#numpy.typing.NDArray">NDArray</a>[<a class="autorefs autorefs-internal" title="numpy.floating" href="#numpy.floating">floating</a> | <a class="autorefs autorefs-internal" title="numpy.complexfloating" href="#numpy.complexfloating">complexfloating</a>]]</code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Lists of cell sizes for all axes
|
|
<code>[[dx_0, dx_1, ...], [dy_0, dy_1, ...], ...]</code>.</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
<p><span class="doc-section-title">Returns:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title="scipy.sparse.sparray" href="#scipy.sparse.sparray">sparray</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Sparse matrix for taking the discretized curl of the H-field</p>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="doc doc-object doc-module">
|
|
|
|
|
|
|
|
<h2 id="api-fdmath-meanas.fdmath.vectorization" class="doc doc-heading">
|
|
<code class="doc-symbol doc-symbol-heading doc-symbol-module"></code> <span class="doc doc-object-name doc-module-name">meanas.fdmath.vectorization</span>
|
|
|
|
|
|
<a href="#api-fdmath-meanas.fdmath.vectorization" class="headerlink" title="Permanent link">¶</a></h2>
|
|
|
|
<div class="doc doc-contents first">
|
|
|
|
<p>Functions for moving between a vector field (list of 3 ndarrays, <code>[f_x, f_y, f_z]</code>)
|
|
and a 1D array representation of that field <code>[f_x0, f_x1, f_x2,... f_y0,... f_z0,...]</code>.
|
|
Vectorized versions of the field use row-major (ie., C-style) ordering.</p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="doc doc-children">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="doc doc-object doc-function">
|
|
|
|
|
|
<h3 id="api-fdmath-meanas.fdmath.vectorization.vec" class="doc doc-heading">
|
|
<code class="doc-symbol doc-symbol-heading doc-symbol-function"></code> <span class="doc doc-object-name doc-function-name">vec</span>
|
|
|
|
|
|
<a href="#api-fdmath-meanas.fdmath.vectorization.vec" class="headerlink" title="Permanent link">¶</a></h3>
|
|
<div class="doc-overloads">
|
|
<div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#api-fdmath-__codelineno-0-1"></a><span class="nf">vec</span><span class="p">(</span><span class="n">f</span><span class="p">:</span> <span class="kc">None</span><span class="p">)</span> <span class="o">-></span> <span class="kc">None</span>
|
|
</code></pre></div><div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#api-fdmath-__codelineno-0-1"></a><span class="nf">vec</span><span class="p">(</span><span class="n">f</span><span class="p">:</span> <span class="n">fdfield_t</span><span class="p">)</span> <span class="o">-></span> <span class="n">vfdfield_t</span>
|
|
</code></pre></div><div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#api-fdmath-__codelineno-0-1"></a><span class="nf">vec</span><span class="p">(</span><span class="n">f</span><span class="p">:</span> <span class="n">cfdfield_t</span><span class="p">)</span> <span class="o">-></span> <span class="n">vcfdfield_t</span>
|
|
</code></pre></div><div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#api-fdmath-__codelineno-0-1"></a><span class="nf">vec</span><span class="p">(</span><span class="n">f</span><span class="p">:</span> <span class="n">fdfield2_t</span><span class="p">)</span> <span class="o">-></span> <span class="n">vfdfield2_t</span>
|
|
</code></pre></div><div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#api-fdmath-__codelineno-0-1"></a><span class="nf">vec</span><span class="p">(</span><span class="n">f</span><span class="p">:</span> <span class="n">cfdfield2_t</span><span class="p">)</span> <span class="o">-></span> <span class="n">vcfdfield2_t</span>
|
|
</code></pre></div><div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#api-fdmath-__codelineno-0-1"></a><span class="nf">vec</span><span class="p">(</span><span class="n">f</span><span class="p">:</span> <span class="n">fdslice_t</span><span class="p">)</span> <span class="o">-></span> <span class="n">vfdslice_t</span>
|
|
</code></pre></div><div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#api-fdmath-__codelineno-0-1"></a><span class="nf">vec</span><span class="p">(</span><span class="n">f</span><span class="p">:</span> <span class="n">cfdslice_t</span><span class="p">)</span> <span class="o">-></span> <span class="n">vcfdslice_t</span>
|
|
</code></pre></div><div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#api-fdmath-__codelineno-0-1"></a><span class="nf">vec</span><span class="p">(</span><span class="n">f</span><span class="p">:</span> <span class="n">ArrayLike</span><span class="p">)</span> <span class="o">-></span> <span class="n">NDArray</span>
|
|
</code></pre></div> </div>
|
|
<div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#api-fdmath-__codelineno-0-1"></a><span class="nf">vec</span><span class="p">(</span>
|
|
<a id="__codelineno-0-2" name="__codelineno-0-2" href="#api-fdmath-__codelineno-0-2"></a> <span class="n">f</span><span class="p">:</span> <span class="n">fdfield_t</span>
|
|
<a id="__codelineno-0-3" name="__codelineno-0-3" href="#api-fdmath-__codelineno-0-3"></a> <span class="o">|</span> <span class="n">cfdfield_t</span>
|
|
<a id="__codelineno-0-4" name="__codelineno-0-4" href="#api-fdmath-__codelineno-0-4"></a> <span class="o">|</span> <span class="n">fdfield2_t</span>
|
|
<a id="__codelineno-0-5" name="__codelineno-0-5" href="#api-fdmath-__codelineno-0-5"></a> <span class="o">|</span> <span class="n">cfdfield2_t</span>
|
|
<a id="__codelineno-0-6" name="__codelineno-0-6" href="#api-fdmath-__codelineno-0-6"></a> <span class="o">|</span> <span class="n">fdslice_t</span>
|
|
<a id="__codelineno-0-7" name="__codelineno-0-7" href="#api-fdmath-__codelineno-0-7"></a> <span class="o">|</span> <span class="n">cfdslice_t</span>
|
|
<a id="__codelineno-0-8" name="__codelineno-0-8" href="#api-fdmath-__codelineno-0-8"></a> <span class="o">|</span> <span class="n">ArrayLike</span>
|
|
<a id="__codelineno-0-9" name="__codelineno-0-9" href="#api-fdmath-__codelineno-0-9"></a> <span class="o">|</span> <span class="kc">None</span><span class="p">,</span>
|
|
<a id="__codelineno-0-10" name="__codelineno-0-10" href="#api-fdmath-__codelineno-0-10"></a><span class="p">)</span> <span class="o">-></span> <span class="p">(</span>
|
|
<a id="__codelineno-0-11" name="__codelineno-0-11" href="#api-fdmath-__codelineno-0-11"></a> <span class="n">vfdfield_t</span>
|
|
<a id="__codelineno-0-12" name="__codelineno-0-12" href="#api-fdmath-__codelineno-0-12"></a> <span class="o">|</span> <span class="n">vcfdfield_t</span>
|
|
<a id="__codelineno-0-13" name="__codelineno-0-13" href="#api-fdmath-__codelineno-0-13"></a> <span class="o">|</span> <span class="n">vfdfield2_t</span>
|
|
<a id="__codelineno-0-14" name="__codelineno-0-14" href="#api-fdmath-__codelineno-0-14"></a> <span class="o">|</span> <span class="n">vcfdfield2_t</span>
|
|
<a id="__codelineno-0-15" name="__codelineno-0-15" href="#api-fdmath-__codelineno-0-15"></a> <span class="o">|</span> <span class="n">vfdslice_t</span>
|
|
<a id="__codelineno-0-16" name="__codelineno-0-16" href="#api-fdmath-__codelineno-0-16"></a> <span class="o">|</span> <span class="n">vcfdslice_t</span>
|
|
<a id="__codelineno-0-17" name="__codelineno-0-17" href="#api-fdmath-__codelineno-0-17"></a> <span class="o">|</span> <span class="n">NDArray</span>
|
|
<a id="__codelineno-0-18" name="__codelineno-0-18" href="#api-fdmath-__codelineno-0-18"></a> <span class="o">|</span> <span class="kc">None</span>
|
|
<a id="__codelineno-0-19" name="__codelineno-0-19" href="#api-fdmath-__codelineno-0-19"></a><span class="p">)</span>
|
|
</code></pre></div>
|
|
|
|
<div class="doc doc-contents ">
|
|
|
|
<p>Create a 1D ndarray from a vector field which spans a 1-3D region.</p>
|
|
<p>Returns <code>None</code> if called with <code>f=None</code>.</p>
|
|
|
|
|
|
<p><span class="doc-section-title">Parameters:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
<th>Default</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>f</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title="meanas.fdmath.types.fdfield_t" href="#meanas.fdmath.types.fdfield_t">fdfield_t</a> | <a class="autorefs autorefs-internal" title="meanas.fdmath.types.cfdfield_t" href="#meanas.fdmath.types.cfdfield_t">cfdfield_t</a> | <a class="autorefs autorefs-internal" title="meanas.fdmath.types.fdfield2_t" href="#meanas.fdmath.types.fdfield2_t">fdfield2_t</a> | <a class="autorefs autorefs-internal" title="meanas.fdmath.types.cfdfield2_t" href="#meanas.fdmath.types.cfdfield2_t">cfdfield2_t</a> | <a class="autorefs autorefs-internal" title="meanas.fdmath.types.fdslice_t" href="#meanas.fdmath.types.fdslice_t">fdslice_t</a> | <a class="autorefs autorefs-internal" title="meanas.fdmath.types.cfdslice_t" href="#meanas.fdmath.types.cfdslice_t">cfdslice_t</a> | <a class="autorefs autorefs-internal" title="numpy.typing.ArrayLike" href="#numpy.typing.ArrayLike">ArrayLike</a> | None</code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>A vector field, e.g. <code>[f_x, f_y, f_z]</code> where each <code>f_</code> component is a 1- to
|
|
3-D ndarray (<code>f_*</code> should all be the same size). Doesn't fail with <code>f=None</code>.</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
<p><span class="doc-section-title">Returns:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title="meanas.fdmath.types.vfdfield_t" href="#meanas.fdmath.types.vfdfield_t">vfdfield_t</a> | <a class="autorefs autorefs-internal" title="meanas.fdmath.types.vcfdfield_t" href="#meanas.fdmath.types.vcfdfield_t">vcfdfield_t</a> | <a class="autorefs autorefs-internal" title="meanas.fdmath.types.vfdfield2_t" href="#meanas.fdmath.types.vfdfield2_t">vfdfield2_t</a> | <a class="autorefs autorefs-internal" title="meanas.fdmath.types.vcfdfield2_t" href="#meanas.fdmath.types.vcfdfield2_t">vcfdfield2_t</a> | <a class="autorefs autorefs-internal" title="meanas.fdmath.types.vfdslice_t" href="#meanas.fdmath.types.vfdslice_t">vfdslice_t</a> | <a class="autorefs autorefs-internal" title="meanas.fdmath.types.vcfdslice_t" href="#meanas.fdmath.types.vcfdslice_t">vcfdslice_t</a> | <a class="autorefs autorefs-internal" title="numpy.typing.NDArray" href="#numpy.typing.NDArray">NDArray</a> | None</code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>1D ndarray containing the linearized field (or <code>None</code>)</p>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="doc doc-object doc-function">
|
|
|
|
|
|
<h3 id="api-fdmath-meanas.fdmath.vectorization.unvec" class="doc doc-heading">
|
|
<code class="doc-symbol doc-symbol-heading doc-symbol-function"></code> <span class="doc doc-object-name doc-function-name">unvec</span>
|
|
|
|
|
|
<a href="#api-fdmath-meanas.fdmath.vectorization.unvec" class="headerlink" title="Permanent link">¶</a></h3>
|
|
<div class="doc-overloads">
|
|
<div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#api-fdmath-__codelineno-0-1"></a><span class="nf">unvec</span><span class="p">(</span>
|
|
<a id="__codelineno-0-2" name="__codelineno-0-2" href="#api-fdmath-__codelineno-0-2"></a> <span class="n">v</span><span class="p">:</span> <span class="kc">None</span><span class="p">,</span> <span class="n">shape</span><span class="p">:</span> <span class="n">Sequence</span><span class="p">[</span><span class="nb">int</span><span class="p">],</span> <span class="n">nvdim</span><span class="p">:</span> <span class="nb">int</span> <span class="o">=</span> <span class="mi">3</span>
|
|
<a id="__codelineno-0-3" name="__codelineno-0-3" href="#api-fdmath-__codelineno-0-3"></a><span class="p">)</span> <span class="o">-></span> <span class="kc">None</span>
|
|
</code></pre></div><div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#api-fdmath-__codelineno-0-1"></a><span class="nf">unvec</span><span class="p">(</span>
|
|
<a id="__codelineno-0-2" name="__codelineno-0-2" href="#api-fdmath-__codelineno-0-2"></a> <span class="n">v</span><span class="p">:</span> <span class="n">vfdfield_t</span><span class="p">,</span> <span class="n">shape</span><span class="p">:</span> <span class="n">Sequence</span><span class="p">[</span><span class="nb">int</span><span class="p">],</span> <span class="n">nvdim</span><span class="p">:</span> <span class="nb">int</span> <span class="o">=</span> <span class="mi">3</span>
|
|
<a id="__codelineno-0-3" name="__codelineno-0-3" href="#api-fdmath-__codelineno-0-3"></a><span class="p">)</span> <span class="o">-></span> <span class="n">fdfield_t</span>
|
|
</code></pre></div><div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#api-fdmath-__codelineno-0-1"></a><span class="nf">unvec</span><span class="p">(</span>
|
|
<a id="__codelineno-0-2" name="__codelineno-0-2" href="#api-fdmath-__codelineno-0-2"></a> <span class="n">v</span><span class="p">:</span> <span class="n">vcfdfield_t</span><span class="p">,</span> <span class="n">shape</span><span class="p">:</span> <span class="n">Sequence</span><span class="p">[</span><span class="nb">int</span><span class="p">],</span> <span class="n">nvdim</span><span class="p">:</span> <span class="nb">int</span> <span class="o">=</span> <span class="mi">3</span>
|
|
<a id="__codelineno-0-3" name="__codelineno-0-3" href="#api-fdmath-__codelineno-0-3"></a><span class="p">)</span> <span class="o">-></span> <span class="n">cfdfield_t</span>
|
|
</code></pre></div><div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#api-fdmath-__codelineno-0-1"></a><span class="nf">unvec</span><span class="p">(</span>
|
|
<a id="__codelineno-0-2" name="__codelineno-0-2" href="#api-fdmath-__codelineno-0-2"></a> <span class="n">v</span><span class="p">:</span> <span class="n">vfdfield2_t</span><span class="p">,</span> <span class="n">shape</span><span class="p">:</span> <span class="n">Sequence</span><span class="p">[</span><span class="nb">int</span><span class="p">],</span> <span class="n">nvdim</span><span class="p">:</span> <span class="nb">int</span> <span class="o">=</span> <span class="mi">3</span>
|
|
<a id="__codelineno-0-3" name="__codelineno-0-3" href="#api-fdmath-__codelineno-0-3"></a><span class="p">)</span> <span class="o">-></span> <span class="n">fdfield2_t</span>
|
|
</code></pre></div><div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#api-fdmath-__codelineno-0-1"></a><span class="nf">unvec</span><span class="p">(</span>
|
|
<a id="__codelineno-0-2" name="__codelineno-0-2" href="#api-fdmath-__codelineno-0-2"></a> <span class="n">v</span><span class="p">:</span> <span class="n">vcfdfield2_t</span><span class="p">,</span> <span class="n">shape</span><span class="p">:</span> <span class="n">Sequence</span><span class="p">[</span><span class="nb">int</span><span class="p">],</span> <span class="n">nvdim</span><span class="p">:</span> <span class="nb">int</span> <span class="o">=</span> <span class="mi">3</span>
|
|
<a id="__codelineno-0-3" name="__codelineno-0-3" href="#api-fdmath-__codelineno-0-3"></a><span class="p">)</span> <span class="o">-></span> <span class="n">cfdfield2_t</span>
|
|
</code></pre></div><div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#api-fdmath-__codelineno-0-1"></a><span class="nf">unvec</span><span class="p">(</span>
|
|
<a id="__codelineno-0-2" name="__codelineno-0-2" href="#api-fdmath-__codelineno-0-2"></a> <span class="n">v</span><span class="p">:</span> <span class="n">vfdslice_t</span><span class="p">,</span> <span class="n">shape</span><span class="p">:</span> <span class="n">Sequence</span><span class="p">[</span><span class="nb">int</span><span class="p">],</span> <span class="n">nvdim</span><span class="p">:</span> <span class="nb">int</span> <span class="o">=</span> <span class="mi">3</span>
|
|
<a id="__codelineno-0-3" name="__codelineno-0-3" href="#api-fdmath-__codelineno-0-3"></a><span class="p">)</span> <span class="o">-></span> <span class="n">fdslice_t</span>
|
|
</code></pre></div><div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#api-fdmath-__codelineno-0-1"></a><span class="nf">unvec</span><span class="p">(</span>
|
|
<a id="__codelineno-0-2" name="__codelineno-0-2" href="#api-fdmath-__codelineno-0-2"></a> <span class="n">v</span><span class="p">:</span> <span class="n">vcfdslice_t</span><span class="p">,</span> <span class="n">shape</span><span class="p">:</span> <span class="n">Sequence</span><span class="p">[</span><span class="nb">int</span><span class="p">],</span> <span class="n">nvdim</span><span class="p">:</span> <span class="nb">int</span> <span class="o">=</span> <span class="mi">3</span>
|
|
<a id="__codelineno-0-3" name="__codelineno-0-3" href="#api-fdmath-__codelineno-0-3"></a><span class="p">)</span> <span class="o">-></span> <span class="n">cfdslice_t</span>
|
|
</code></pre></div><div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#api-fdmath-__codelineno-0-1"></a><span class="nf">unvec</span><span class="p">(</span>
|
|
<a id="__codelineno-0-2" name="__codelineno-0-2" href="#api-fdmath-__codelineno-0-2"></a> <span class="n">v</span><span class="p">:</span> <span class="n">ArrayLike</span><span class="p">,</span> <span class="n">shape</span><span class="p">:</span> <span class="n">Sequence</span><span class="p">[</span><span class="nb">int</span><span class="p">],</span> <span class="n">nvdim</span><span class="p">:</span> <span class="nb">int</span> <span class="o">=</span> <span class="mi">3</span>
|
|
<a id="__codelineno-0-3" name="__codelineno-0-3" href="#api-fdmath-__codelineno-0-3"></a><span class="p">)</span> <span class="o">-></span> <span class="n">NDArray</span>
|
|
</code></pre></div> </div>
|
|
<div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#api-fdmath-__codelineno-0-1"></a><span class="nf">unvec</span><span class="p">(</span>
|
|
<a id="__codelineno-0-2" name="__codelineno-0-2" href="#api-fdmath-__codelineno-0-2"></a> <span class="n">v</span><span class="p">:</span> <span class="n">vfdfield_t</span>
|
|
<a id="__codelineno-0-3" name="__codelineno-0-3" href="#api-fdmath-__codelineno-0-3"></a> <span class="o">|</span> <span class="n">vcfdfield_t</span>
|
|
<a id="__codelineno-0-4" name="__codelineno-0-4" href="#api-fdmath-__codelineno-0-4"></a> <span class="o">|</span> <span class="n">vfdfield2_t</span>
|
|
<a id="__codelineno-0-5" name="__codelineno-0-5" href="#api-fdmath-__codelineno-0-5"></a> <span class="o">|</span> <span class="n">vcfdfield2_t</span>
|
|
<a id="__codelineno-0-6" name="__codelineno-0-6" href="#api-fdmath-__codelineno-0-6"></a> <span class="o">|</span> <span class="n">vfdslice_t</span>
|
|
<a id="__codelineno-0-7" name="__codelineno-0-7" href="#api-fdmath-__codelineno-0-7"></a> <span class="o">|</span> <span class="n">vcfdslice_t</span>
|
|
<a id="__codelineno-0-8" name="__codelineno-0-8" href="#api-fdmath-__codelineno-0-8"></a> <span class="o">|</span> <span class="n">ArrayLike</span>
|
|
<a id="__codelineno-0-9" name="__codelineno-0-9" href="#api-fdmath-__codelineno-0-9"></a> <span class="o">|</span> <span class="kc">None</span><span class="p">,</span>
|
|
<a id="__codelineno-0-10" name="__codelineno-0-10" href="#api-fdmath-__codelineno-0-10"></a> <span class="n">shape</span><span class="p">:</span> <span class="n">Sequence</span><span class="p">[</span><span class="nb">int</span><span class="p">],</span>
|
|
<a id="__codelineno-0-11" name="__codelineno-0-11" href="#api-fdmath-__codelineno-0-11"></a> <span class="n">nvdim</span><span class="p">:</span> <span class="nb">int</span> <span class="o">=</span> <span class="mi">3</span><span class="p">,</span>
|
|
<a id="__codelineno-0-12" name="__codelineno-0-12" href="#api-fdmath-__codelineno-0-12"></a><span class="p">)</span> <span class="o">-></span> <span class="p">(</span>
|
|
<a id="__codelineno-0-13" name="__codelineno-0-13" href="#api-fdmath-__codelineno-0-13"></a> <span class="n">fdfield_t</span>
|
|
<a id="__codelineno-0-14" name="__codelineno-0-14" href="#api-fdmath-__codelineno-0-14"></a> <span class="o">|</span> <span class="n">cfdfield_t</span>
|
|
<a id="__codelineno-0-15" name="__codelineno-0-15" href="#api-fdmath-__codelineno-0-15"></a> <span class="o">|</span> <span class="n">fdfield2_t</span>
|
|
<a id="__codelineno-0-16" name="__codelineno-0-16" href="#api-fdmath-__codelineno-0-16"></a> <span class="o">|</span> <span class="n">cfdfield2_t</span>
|
|
<a id="__codelineno-0-17" name="__codelineno-0-17" href="#api-fdmath-__codelineno-0-17"></a> <span class="o">|</span> <span class="n">fdslice_t</span>
|
|
<a id="__codelineno-0-18" name="__codelineno-0-18" href="#api-fdmath-__codelineno-0-18"></a> <span class="o">|</span> <span class="n">cfdslice_t</span>
|
|
<a id="__codelineno-0-19" name="__codelineno-0-19" href="#api-fdmath-__codelineno-0-19"></a> <span class="o">|</span> <span class="n">NDArray</span>
|
|
<a id="__codelineno-0-20" name="__codelineno-0-20" href="#api-fdmath-__codelineno-0-20"></a> <span class="o">|</span> <span class="kc">None</span>
|
|
<a id="__codelineno-0-21" name="__codelineno-0-21" href="#api-fdmath-__codelineno-0-21"></a><span class="p">)</span>
|
|
</code></pre></div>
|
|
|
|
<div class="doc doc-contents ">
|
|
|
|
<p>Perform the inverse of vec(): take a 1D ndarray and output an <code>nvdim</code>-component field
|
|
of form e.g. <code>[f_x, f_y, f_z]</code> (<code>nvdim=3</code>) where each of <code>f_*</code> is a len(shape)-dimensional
|
|
ndarray.</p>
|
|
<p>Returns <code>None</code> if called with <code>v=None</code>.</p>
|
|
|
|
|
|
<p><span class="doc-section-title">Parameters:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
<th>Default</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>v</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title="meanas.fdmath.types.vfdfield_t" href="#meanas.fdmath.types.vfdfield_t">vfdfield_t</a> | <a class="autorefs autorefs-internal" title="meanas.fdmath.types.vcfdfield_t" href="#meanas.fdmath.types.vcfdfield_t">vcfdfield_t</a> | <a class="autorefs autorefs-internal" title="meanas.fdmath.types.vfdfield2_t" href="#meanas.fdmath.types.vfdfield2_t">vfdfield2_t</a> | <a class="autorefs autorefs-internal" title="meanas.fdmath.types.vcfdfield2_t" href="#meanas.fdmath.types.vcfdfield2_t">vcfdfield2_t</a> | <a class="autorefs autorefs-internal" title="meanas.fdmath.types.vfdslice_t" href="#meanas.fdmath.types.vfdslice_t">vfdslice_t</a> | <a class="autorefs autorefs-internal" title="meanas.fdmath.types.vcfdslice_t" href="#meanas.fdmath.types.vcfdslice_t">vcfdslice_t</a> | <a class="autorefs autorefs-internal" title="numpy.typing.ArrayLike" href="#numpy.typing.ArrayLike">ArrayLike</a> | None</code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>1D ndarray representing a vector field of shape shape (or None)</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>shape</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title="collections.abc.Sequence" href="#collections.abc.Sequence">Sequence</a>[<a class="autorefs autorefs-internal" href="#index-recommended-starting-points">int</a>]</code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>shape of the vector field</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<em>required</em>
|
|
</td>
|
|
</tr>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code>nvdim</code>
|
|
</td>
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" href="#index-recommended-starting-points">int</a></code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p>Number of components in each vector</p>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<code>3</code>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
<p><span class="doc-section-title">Returns:</span></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr class="doc-section-item">
|
|
<td>
|
|
<code><a class="autorefs autorefs-internal" title="meanas.fdmath.types.fdfield_t" href="#meanas.fdmath.types.fdfield_t">fdfield_t</a> | <a class="autorefs autorefs-internal" title="meanas.fdmath.types.cfdfield_t" href="#meanas.fdmath.types.cfdfield_t">cfdfield_t</a> | <a class="autorefs autorefs-internal" title="meanas.fdmath.types.fdfield2_t" href="#meanas.fdmath.types.fdfield2_t">fdfield2_t</a> | <a class="autorefs autorefs-internal" title="meanas.fdmath.types.cfdfield2_t" href="#meanas.fdmath.types.cfdfield2_t">cfdfield2_t</a> | <a class="autorefs autorefs-internal" title="meanas.fdmath.types.fdslice_t" href="#meanas.fdmath.types.fdslice_t">fdslice_t</a> | <a class="autorefs autorefs-internal" title="meanas.fdmath.types.cfdslice_t" href="#meanas.fdmath.types.cfdslice_t">cfdslice_t</a> | <a class="autorefs autorefs-internal" title="numpy.typing.NDArray" href="#numpy.typing.NDArray">NDArray</a> | None</code>
|
|
</td>
|
|
<td>
|
|
<div class="doc-md-description">
|
|
<p><code>[f_x, f_y, f_z]</code> where each <code>f_</code> is a <code>len(shape)</code> dimensional ndarray (or <code>None</code>)</p>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="doc doc-object doc-module">
|
|
|
|
|
|
|
|
<h2 id="api-fdmath-meanas.fdmath.types" class="doc doc-heading">
|
|
<code class="doc-symbol doc-symbol-heading doc-symbol-module"></code> <span class="doc doc-object-name doc-module-name">meanas.fdmath.types</span>
|
|
|
|
|
|
<a href="#api-fdmath-meanas.fdmath.types" class="headerlink" title="Permanent link">¶</a></h2>
|
|
|
|
<div class="doc doc-contents first">
|
|
|
|
<p>Types shared across multiple submodules</p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="doc doc-children">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="doc doc-object doc-attribute">
|
|
|
|
|
|
|
|
<h3 id="api-fdmath-meanas.fdmath.types.dx_lists_t" class="doc doc-heading">
|
|
<code class="doc-symbol doc-symbol-heading doc-symbol-attribute"></code> <span class="doc doc-object-name doc-attribute-name">dx_lists_t</span>
|
|
|
|
|
|
<span class="doc doc-labels">
|
|
<small class="doc doc-label doc-label-module-attribute"><code>module-attribute</code></small>
|
|
</span>
|
|
|
|
<a href="#api-fdmath-meanas.fdmath.types.dx_lists_t" class="headerlink" title="Permanent link">¶</a></h3>
|
|
<div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#api-fdmath-__codelineno-0-1"></a><span class="n">dx_lists_t</span> <span class="o">=</span> <span class="n">Sequence</span><span class="p">[</span>
|
|
<a id="__codelineno-0-2" name="__codelineno-0-2" href="#api-fdmath-__codelineno-0-2"></a> <span class="n">Sequence</span><span class="p">[</span><span class="n">NDArray</span><span class="p">[</span><span class="n">floating</span> <span class="o">|</span> <span class="n">complexfloating</span><span class="p">]]</span>
|
|
<a id="__codelineno-0-3" name="__codelineno-0-3" href="#api-fdmath-__codelineno-0-3"></a><span class="p">]</span>
|
|
</code></pre></div>
|
|
|
|
<div class="doc doc-contents ">
|
|
|
|
<p>'dxes' datastructure which contains grid cell width information in the following format:</p>
|
|
<div class="highlight"><pre><span></span><code>[[[dx_e[0], dx_e[1], ...], [dy_e[0], ...], [dz_e[0], ...]],
|
|
[[dx_h[0], dx_h[1], ...], [dy_h[0], ...], [dz_h[0], ...]]]
|
|
</code></pre></div>
|
|
<p>where <code>dx_e[0]</code> is the x-width of the <code>x=0</code> cells, as used when calculating dE/dx,
|
|
and <code>dy_h[0]</code> is the y-width of the <code>y=0</code> cells, as used when calculating dH/dy, etc.</p>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="doc doc-object doc-attribute">
|
|
|
|
|
|
|
|
<h3 id="api-fdmath-meanas.fdmath.types.dx_lists2_t" class="doc doc-heading">
|
|
<code class="doc-symbol doc-symbol-heading doc-symbol-attribute"></code> <span class="doc doc-object-name doc-attribute-name">dx_lists2_t</span>
|
|
|
|
|
|
<span class="doc doc-labels">
|
|
<small class="doc doc-label doc-label-module-attribute"><code>module-attribute</code></small>
|
|
</span>
|
|
|
|
<a href="#api-fdmath-meanas.fdmath.types.dx_lists2_t" class="headerlink" title="Permanent link">¶</a></h3>
|
|
<div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#api-fdmath-__codelineno-0-1"></a><span class="n">dx_lists2_t</span> <span class="o">=</span> <span class="n">Sequence</span><span class="p">[</span>
|
|
<a id="__codelineno-0-2" name="__codelineno-0-2" href="#api-fdmath-__codelineno-0-2"></a> <span class="n">Sequence</span><span class="p">[</span><span class="n">NDArray</span><span class="p">[</span><span class="n">floating</span> <span class="o">|</span> <span class="n">complexfloating</span><span class="p">]]</span>
|
|
<a id="__codelineno-0-3" name="__codelineno-0-3" href="#api-fdmath-__codelineno-0-3"></a><span class="p">]</span>
|
|
</code></pre></div>
|
|
|
|
<div class="doc doc-contents ">
|
|
|
|
<p>2D 'dxes' datastructure which contains grid cell width information in the following format:</p>
|
|
<div class="highlight"><pre><span></span><code>[[[dx_e[0], dx_e[1], ...], [dy_e[0], ...]],
|
|
[[dx_h[0], dx_h[1], ...], [dy_h[0], ...]]]
|
|
</code></pre></div>
|
|
<p>where <code>dx_e[0]</code> is the x-width of the <code>x=0</code> cells, as used when calculating dE/dx,
|
|
and <code>dy_h[0]</code> is the y-width of the <code>y=0</code> cells, as used when calculating dH/dy, etc.</p>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="doc doc-object doc-attribute">
|
|
|
|
|
|
|
|
<h3 id="api-fdmath-meanas.fdmath.types.dx_lists_mut" class="doc doc-heading">
|
|
<code class="doc-symbol doc-symbol-heading doc-symbol-attribute"></code> <span class="doc doc-object-name doc-attribute-name">dx_lists_mut</span>
|
|
|
|
|
|
<span class="doc doc-labels">
|
|
<small class="doc doc-label doc-label-module-attribute"><code>module-attribute</code></small>
|
|
</span>
|
|
|
|
<a href="#api-fdmath-meanas.fdmath.types.dx_lists_mut" class="headerlink" title="Permanent link">¶</a></h3>
|
|
<div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#api-fdmath-__codelineno-0-1"></a><span class="n">dx_lists_mut</span> <span class="o">=</span> <span class="n">MutableSequence</span><span class="p">[</span>
|
|
<a id="__codelineno-0-2" name="__codelineno-0-2" href="#api-fdmath-__codelineno-0-2"></a> <span class="n">MutableSequence</span><span class="p">[</span><span class="n">NDArray</span><span class="p">[</span><span class="n">floating</span> <span class="o">|</span> <span class="n">complexfloating</span><span class="p">]]</span>
|
|
<a id="__codelineno-0-3" name="__codelineno-0-3" href="#api-fdmath-__codelineno-0-3"></a><span class="p">]</span>
|
|
</code></pre></div>
|
|
|
|
<div class="doc doc-contents ">
|
|
|
|
<p>Mutable version of <code>dx_lists_t</code></p>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="doc doc-object doc-attribute">
|
|
|
|
|
|
|
|
<h3 id="api-fdmath-meanas.fdmath.types.dx_lists2_mut" class="doc doc-heading">
|
|
<code class="doc-symbol doc-symbol-heading doc-symbol-attribute"></code> <span class="doc doc-object-name doc-attribute-name">dx_lists2_mut</span>
|
|
|
|
|
|
<span class="doc doc-labels">
|
|
<small class="doc doc-label doc-label-module-attribute"><code>module-attribute</code></small>
|
|
</span>
|
|
|
|
<a href="#api-fdmath-meanas.fdmath.types.dx_lists2_mut" class="headerlink" title="Permanent link">¶</a></h3>
|
|
<div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#api-fdmath-__codelineno-0-1"></a><span class="n">dx_lists2_mut</span> <span class="o">=</span> <span class="n">MutableSequence</span><span class="p">[</span>
|
|
<a id="__codelineno-0-2" name="__codelineno-0-2" href="#api-fdmath-__codelineno-0-2"></a> <span class="n">MutableSequence</span><span class="p">[</span><span class="n">NDArray</span><span class="p">[</span><span class="n">floating</span> <span class="o">|</span> <span class="n">complexfloating</span><span class="p">]]</span>
|
|
<a id="__codelineno-0-3" name="__codelineno-0-3" href="#api-fdmath-__codelineno-0-3"></a><span class="p">]</span>
|
|
</code></pre></div>
|
|
|
|
<div class="doc doc-contents ">
|
|
|
|
<p>Mutable version of <code>dx_lists2_t</code></p>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="doc doc-object doc-attribute">
|
|
|
|
|
|
|
|
<h3 id="api-fdmath-meanas.fdmath.types.fdfield_updater_t" class="doc doc-heading">
|
|
<code class="doc-symbol doc-symbol-heading doc-symbol-attribute"></code> <span class="doc doc-object-name doc-attribute-name">fdfield_updater_t</span>
|
|
|
|
|
|
<span class="doc doc-labels">
|
|
<small class="doc doc-label doc-label-module-attribute"><code>module-attribute</code></small>
|
|
</span>
|
|
|
|
<a href="#api-fdmath-meanas.fdmath.types.fdfield_updater_t" class="headerlink" title="Permanent link">¶</a></h3>
|
|
<div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#api-fdmath-__codelineno-0-1"></a><span class="n">fdfield_updater_t</span> <span class="o">=</span> <span class="n">Callable</span><span class="p">[</span><span class="o">...</span><span class="p">,</span> <span class="n">fdfield_t</span><span class="p">]</span>
|
|
</code></pre></div>
|
|
|
|
<div class="doc doc-contents ">
|
|
|
|
<p>Convenience type for functions which take and return an fdfield_t</p>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="doc doc-object doc-attribute">
|
|
|
|
|
|
|
|
<h3 id="api-fdmath-meanas.fdmath.types.cfdfield_updater_t" class="doc doc-heading">
|
|
<code class="doc-symbol doc-symbol-heading doc-symbol-attribute"></code> <span class="doc doc-object-name doc-attribute-name">cfdfield_updater_t</span>
|
|
|
|
|
|
<span class="doc doc-labels">
|
|
<small class="doc doc-label doc-label-module-attribute"><code>module-attribute</code></small>
|
|
</span>
|
|
|
|
<a href="#api-fdmath-meanas.fdmath.types.cfdfield_updater_t" class="headerlink" title="Permanent link">¶</a></h3>
|
|
<div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#api-fdmath-__codelineno-0-1"></a><span class="n">cfdfield_updater_t</span> <span class="o">=</span> <span class="n">Callable</span><span class="p">[</span><span class="o">...</span><span class="p">,</span> <span class="n">cfdfield_t</span><span class="p">]</span>
|
|
</code></pre></div>
|
|
|
|
<div class="doc doc-contents ">
|
|
|
|
<p>Convenience type for functions which take and return an cfdfield_t</p>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
<div class="doc doc-object doc-type_alias">
|
|
|
|
|
|
|
|
<h3 id="api-fdmath-meanas.fdmath.types.fdfield" class="doc doc-heading">
|
|
<code class="doc-symbol doc-symbol-heading doc-symbol-type_alias"></code> <span class="doc doc-object-name doc-type_alias-name">fdfield</span>
|
|
|
|
|
|
<a href="#api-fdmath-meanas.fdmath.types.fdfield" class="headerlink" title="Permanent link">¶</a></h3>
|
|
<div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#api-fdmath-__codelineno-0-1"></a><span class="nc">fdfield</span> <span class="o">=</span> <span class="n">fdfield_t</span> <span class="o">|</span> <span class="n">NDArray</span><span class="p">[</span><span class="n">floating</span><span class="p">]</span>
|
|
</code></pre></div>
|
|
|
|
<div class="doc doc-contents ">
|
|
|
|
<p>Vector field with shape (3, X, Y, Z) (e.g. <code>[E_x, E_y, E_z]</code>)</p>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="doc doc-object doc-type_alias">
|
|
|
|
|
|
|
|
<h3 id="api-fdmath-meanas.fdmath.types.vfdfield" class="doc doc-heading">
|
|
<code class="doc-symbol doc-symbol-heading doc-symbol-type_alias"></code> <span class="doc doc-object-name doc-type_alias-name">vfdfield</span>
|
|
|
|
|
|
<a href="#api-fdmath-meanas.fdmath.types.vfdfield" class="headerlink" title="Permanent link">¶</a></h3>
|
|
<div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#api-fdmath-__codelineno-0-1"></a><span class="nc">vfdfield</span> <span class="o">=</span> <span class="n">vfdfield_t</span> <span class="o">|</span> <span class="n">NDArray</span><span class="p">[</span><span class="n">floating</span><span class="p">]</span>
|
|
</code></pre></div>
|
|
|
|
<div class="doc doc-contents ">
|
|
|
|
<p>Linearized vector field (single vector of length 3<em>X</em>Y*Z)</p>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="doc doc-object doc-type_alias">
|
|
|
|
|
|
|
|
<h3 id="api-fdmath-meanas.fdmath.types.cfdfield" class="doc doc-heading">
|
|
<code class="doc-symbol doc-symbol-heading doc-symbol-type_alias"></code> <span class="doc doc-object-name doc-type_alias-name">cfdfield</span>
|
|
|
|
|
|
<a href="#api-fdmath-meanas.fdmath.types.cfdfield" class="headerlink" title="Permanent link">¶</a></h3>
|
|
<div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#api-fdmath-__codelineno-0-1"></a><span class="nc">cfdfield</span> <span class="o">=</span> <span class="n">cfdfield_t</span> <span class="o">|</span> <span class="n">NDArray</span><span class="p">[</span><span class="n">complexfloating</span><span class="p">]</span>
|
|
</code></pre></div>
|
|
|
|
<div class="doc doc-contents ">
|
|
|
|
<p>Complex vector field with shape (3, X, Y, Z) (e.g. <code>[E_x, E_y, E_z]</code>)</p>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="doc doc-object doc-type_alias">
|
|
|
|
|
|
|
|
<h3 id="api-fdmath-meanas.fdmath.types.vcfdfield" class="doc doc-heading">
|
|
<code class="doc-symbol doc-symbol-heading doc-symbol-type_alias"></code> <span class="doc doc-object-name doc-type_alias-name">vcfdfield</span>
|
|
|
|
|
|
<a href="#api-fdmath-meanas.fdmath.types.vcfdfield" class="headerlink" title="Permanent link">¶</a></h3>
|
|
<div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#api-fdmath-__codelineno-0-1"></a><span class="nc">vcfdfield</span> <span class="o">=</span> <span class="n">vcfdfield_t</span> <span class="o">|</span> <span class="n">NDArray</span><span class="p">[</span><span class="n">complexfloating</span><span class="p">]</span>
|
|
</code></pre></div>
|
|
|
|
<div class="doc doc-contents ">
|
|
|
|
<p>Linearized complex vector field (single vector of length 3<em>X</em>Y*Z)</p>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="doc doc-object doc-type_alias">
|
|
|
|
|
|
|
|
<h3 id="api-fdmath-meanas.fdmath.types.fdslice" class="doc doc-heading">
|
|
<code class="doc-symbol doc-symbol-heading doc-symbol-type_alias"></code> <span class="doc doc-object-name doc-type_alias-name">fdslice</span>
|
|
|
|
|
|
<a href="#api-fdmath-meanas.fdmath.types.fdslice" class="headerlink" title="Permanent link">¶</a></h3>
|
|
<div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#api-fdmath-__codelineno-0-1"></a><span class="nc">fdslice</span> <span class="o">=</span> <span class="n">fdslice_t</span> <span class="o">|</span> <span class="n">NDArray</span><span class="p">[</span><span class="n">floating</span><span class="p">]</span>
|
|
</code></pre></div>
|
|
|
|
<div class="doc doc-contents ">
|
|
|
|
<p>Vector field slice with shape (3, X, Y) (e.g. <code>[E_x, E_y, E_z]</code> at a single Z position)</p>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="doc doc-object doc-type_alias">
|
|
|
|
|
|
|
|
<h3 id="api-fdmath-meanas.fdmath.types.vfdslice" class="doc doc-heading">
|
|
<code class="doc-symbol doc-symbol-heading doc-symbol-type_alias"></code> <span class="doc doc-object-name doc-type_alias-name">vfdslice</span>
|
|
|
|
|
|
<a href="#api-fdmath-meanas.fdmath.types.vfdslice" class="headerlink" title="Permanent link">¶</a></h3>
|
|
<div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#api-fdmath-__codelineno-0-1"></a><span class="nc">vfdslice</span> <span class="o">=</span> <span class="n">vfdslice_t</span> <span class="o">|</span> <span class="n">NDArray</span><span class="p">[</span><span class="n">floating</span><span class="p">]</span>
|
|
</code></pre></div>
|
|
|
|
<div class="doc doc-contents ">
|
|
|
|
<p>Linearized vector field slice (single vector of length 3<em>X</em>Y)</p>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="doc doc-object doc-type_alias">
|
|
|
|
|
|
|
|
<h3 id="api-fdmath-meanas.fdmath.types.cfdslice" class="doc doc-heading">
|
|
<code class="doc-symbol doc-symbol-heading doc-symbol-type_alias"></code> <span class="doc doc-object-name doc-type_alias-name">cfdslice</span>
|
|
|
|
|
|
<a href="#api-fdmath-meanas.fdmath.types.cfdslice" class="headerlink" title="Permanent link">¶</a></h3>
|
|
<div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#api-fdmath-__codelineno-0-1"></a><span class="nc">cfdslice</span> <span class="o">=</span> <span class="n">cfdslice_t</span> <span class="o">|</span> <span class="n">NDArray</span><span class="p">[</span><span class="n">complexfloating</span><span class="p">]</span>
|
|
</code></pre></div>
|
|
|
|
<div class="doc doc-contents ">
|
|
|
|
<p>Complex vector field slice with shape (3, X, Y) (e.g. <code>[E_x, E_y, E_z]</code> at a single Z position)</p>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="doc doc-object doc-type_alias">
|
|
|
|
|
|
|
|
<h3 id="api-fdmath-meanas.fdmath.types.vcfdslice" class="doc doc-heading">
|
|
<code class="doc-symbol doc-symbol-heading doc-symbol-type_alias"></code> <span class="doc doc-object-name doc-type_alias-name">vcfdslice</span>
|
|
|
|
|
|
<a href="#api-fdmath-meanas.fdmath.types.vcfdslice" class="headerlink" title="Permanent link">¶</a></h3>
|
|
<div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#api-fdmath-__codelineno-0-1"></a><span class="nc">vcfdslice</span> <span class="o">=</span> <span class="n">vcfdslice_t</span> <span class="o">|</span> <span class="n">NDArray</span><span class="p">[</span><span class="n">complexfloating</span><span class="p">]</span>
|
|
</code></pre></div>
|
|
|
|
<div class="doc doc-contents ">
|
|
|
|
<p>Linearized complex vector field slice (single vector of length 3<em>X</em>Y)</p>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="doc doc-object doc-type_alias">
|
|
|
|
|
|
|
|
<h3 id="api-fdmath-meanas.fdmath.types.fdfield2" class="doc doc-heading">
|
|
<code class="doc-symbol doc-symbol-heading doc-symbol-type_alias"></code> <span class="doc doc-object-name doc-type_alias-name">fdfield2</span>
|
|
|
|
|
|
<a href="#api-fdmath-meanas.fdmath.types.fdfield2" class="headerlink" title="Permanent link">¶</a></h3>
|
|
<div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#api-fdmath-__codelineno-0-1"></a><span class="nc">fdfield2</span> <span class="o">=</span> <span class="n">fdfield2_t</span> <span class="o">|</span> <span class="n">NDArray</span><span class="p">[</span><span class="n">floating</span><span class="p">]</span>
|
|
</code></pre></div>
|
|
|
|
<div class="doc doc-contents ">
|
|
|
|
<p>2D Vector field with shape (2, X, Y) (e.g. <code>[E_x, E_y]</code>)</p>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="doc doc-object doc-type_alias">
|
|
|
|
|
|
|
|
<h3 id="api-fdmath-meanas.fdmath.types.vfdfield2" class="doc doc-heading">
|
|
<code class="doc-symbol doc-symbol-heading doc-symbol-type_alias"></code> <span class="doc doc-object-name doc-type_alias-name">vfdfield2</span>
|
|
|
|
|
|
<a href="#api-fdmath-meanas.fdmath.types.vfdfield2" class="headerlink" title="Permanent link">¶</a></h3>
|
|
<div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#api-fdmath-__codelineno-0-1"></a><span class="nc">vfdfield2</span> <span class="o">=</span> <span class="n">vfdfield2_t</span> <span class="o">|</span> <span class="n">NDArray</span><span class="p">[</span><span class="n">floating</span><span class="p">]</span>
|
|
</code></pre></div>
|
|
|
|
<div class="doc doc-contents ">
|
|
|
|
<p>2D Linearized vector field (single vector of length 2<em>X</em>Y)</p>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="doc doc-object doc-type_alias">
|
|
|
|
|
|
|
|
<h3 id="api-fdmath-meanas.fdmath.types.cfdfield2" class="doc doc-heading">
|
|
<code class="doc-symbol doc-symbol-heading doc-symbol-type_alias"></code> <span class="doc doc-object-name doc-type_alias-name">cfdfield2</span>
|
|
|
|
|
|
<a href="#api-fdmath-meanas.fdmath.types.cfdfield2" class="headerlink" title="Permanent link">¶</a></h3>
|
|
<div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#api-fdmath-__codelineno-0-1"></a><span class="nc">cfdfield2</span> <span class="o">=</span> <span class="n">cfdfield2_t</span> <span class="o">|</span> <span class="n">NDArray</span><span class="p">[</span><span class="n">complexfloating</span><span class="p">]</span>
|
|
</code></pre></div>
|
|
|
|
<div class="doc doc-contents ">
|
|
|
|
<p>2D Complex vector field with shape (2, X, Y) (e.g. <code>[E_x, E_y]</code>)</p>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="doc doc-object doc-type_alias">
|
|
|
|
|
|
|
|
<h3 id="api-fdmath-meanas.fdmath.types.vcfdfield2" class="doc doc-heading">
|
|
<code class="doc-symbol doc-symbol-heading doc-symbol-type_alias"></code> <span class="doc doc-object-name doc-type_alias-name">vcfdfield2</span>
|
|
|
|
|
|
<a href="#api-fdmath-meanas.fdmath.types.vcfdfield2" class="headerlink" title="Permanent link">¶</a></h3>
|
|
<div class="doc-signature highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#api-fdmath-__codelineno-0-1"></a><span class="nc">vcfdfield2</span> <span class="o">=</span> <span class="n">vcfdfield2_t</span> <span class="o">|</span> <span class="n">NDArray</span><span class="p">[</span><span class="n">complexfloating</span><span class="p">]</span>
|
|
</code></pre></div>
|
|
|
|
<div class="doc doc-contents ">
|
|
|
|
<p>2D Linearized complex vector field (single vector of length 2<em>X</em>Y)</p>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div></section></section></div><style>.print-site-enumerate-headings #index > h1:before { content: '1 ' }
|
|
|
|
.print-site-enumerate-headings #index h2:before { content: '1.' counter(counter-index-2) ' ' }
|
|
.print-site-enumerate-headings #index h2 { counter-reset: counter-index-3 ; counter-increment: counter-index-2 }
|
|
|
|
.print-site-enumerate-headings #index h3:before { content: '1.' counter(counter-index-2) '.' counter(counter-index-3) ' ' }
|
|
.print-site-enumerate-headings #index h3 { counter-increment: counter-index-3 }
|
|
|
|
.print-site-enumerate-headings #section-2 > h1:before { content: '2 ' }
|
|
.print-site-enumerate-headings #api > h1:before { content: '2.1 ' }
|
|
|
|
.print-site-enumerate-headings #api h2:before { content: '2.1.' counter(counter-api-2) ' ' }
|
|
.print-site-enumerate-headings #api h2 { counter-increment: counter-api-2 }
|
|
|
|
.print-site-enumerate-headings #api-meanas > h1:before { content: '2.2 ' }
|
|
|
|
.print-site-enumerate-headings #api-meanas h2:before { content: '2.2.' counter(counter-api-meanas-2) ' ' }
|
|
.print-site-enumerate-headings #api-meanas h2 { counter-increment: counter-api-meanas-2 }
|
|
|
|
.print-site-enumerate-headings #api-eigensolvers > h1:before { content: '2.3 ' }
|
|
|
|
.print-site-enumerate-headings #api-eigensolvers h2:before { content: '2.3.' counter(counter-api-eigensolvers-2) ' ' }
|
|
.print-site-enumerate-headings #api-eigensolvers h2 { counter-increment: counter-api-eigensolvers-2 }
|
|
|
|
.print-site-enumerate-headings #api-fdfd > h1:before { content: '2.4 ' }
|
|
|
|
.print-site-enumerate-headings #api-fdfd h2:before { content: '2.4.' counter(counter-api-fdfd-2) ' ' }
|
|
.print-site-enumerate-headings #api-fdfd h2 { counter-increment: counter-api-fdfd-2 }
|
|
|
|
.print-site-enumerate-headings #api-waveguides > h1:before { content: '2.5 ' }
|
|
|
|
.print-site-enumerate-headings #api-waveguides h2:before { content: '2.5.' counter(counter-api-waveguides-2) ' ' }
|
|
.print-site-enumerate-headings #api-waveguides h2 { counter-increment: counter-api-waveguides-2 }
|
|
|
|
.print-site-enumerate-headings #api-fdtd > h1:before { content: '2.6 ' }
|
|
|
|
.print-site-enumerate-headings #api-fdtd h2:before { content: '2.6.' counter(counter-api-fdtd-2) ' ' }
|
|
.print-site-enumerate-headings #api-fdtd h2 { counter-increment: counter-api-fdtd-2 }
|
|
|
|
.print-site-enumerate-headings #api-fdmath > h1:before { content: '2.7 ' }
|
|
|
|
.print-site-enumerate-headings #api-fdmath h2:before { content: '2.7.' counter(counter-api-fdmath-2) ' ' }
|
|
.print-site-enumerate-headings #api-fdmath h2 { counter-increment: counter-api-fdmath-2 }
|
|
</style>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</article>
|
|
</div>
|
|
|
|
|
|
<script>var target=document.getElementById(location.hash.slice(1));target&&target.name&&(target.checked=target.name.startsWith("__tabbed_"))</script>
|
|
</div>
|
|
|
|
<button type="button" class="md-top md-icon" data-md-component="top" hidden>
|
|
|
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M13 20h-2V8l-5.5 5.5-1.42-1.42L12 4.16l7.92 7.92-1.42 1.42L13 8z"/></svg>
|
|
Back to top
|
|
</button>
|
|
|
|
</main>
|
|
|
|
<footer class="md-footer">
|
|
|
|
<div class="md-footer-meta md-typeset">
|
|
<div class="md-footer-meta__inner md-grid">
|
|
<div class="md-copyright">
|
|
|
|
|
|
Made with
|
|
<a href="https://squidfunk.github.io/mkdocs-material/" target="_blank" rel="noopener">
|
|
Material for MkDocs
|
|
</a>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
</footer>
|
|
|
|
</div>
|
|
<div class="md-dialog" data-md-component="dialog">
|
|
<div class="md-dialog__inner md-typeset"></div>
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<script id="__config" type="application/json">{"annotate": null, "base": "/docs/meanas/", "features": ["navigation.indexes", "navigation.sections", "navigation.top", "content.code.copy", "toc.follow"], "search": "../assets/javascripts/workers/search.2c215733.min.js", "tags": null, "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version": "Select version"}, "version": null}</script>
|
|
|
|
|
|
<script src="../assets/javascripts/bundle.79ae519e.min.js"></script>
|
|
|
|
<script src="../js/print-site.js"></script>
|
|
|
|
<script src="../javascripts/mathjax.js"></script>
|
|
|
|
<script src="../assets/vendor/mathjax/startup.js"></script>
|
|
|
|
|
|
</body>
|
|
</html> |