You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<spanid="secdirichlet"></span><h1><spanclass="section-number">7. </span>Dirichlet boundary conditions<aclass="headerlink" href="#dirichlet-boundary-conditions" title="Permalink to this headline">¶</a></h1>
52
+
<spanid="secdirichlet"></span><h1><spanclass="section-number">7. </span>Dirichlet boundary conditions<aclass="headerlink" href="#dirichlet-boundary-conditions" title="Link to this heading">¶</a></h1>
56
53
<p>The Helmholtz problem we solved in the previous part was chosen to
57
54
have homogeneous Neumann or <em>natural</em> boundary conditions, which can
58
55
be implemented simply by cancelling the zero surface integral. We can
@@ -61,11 +58,11 @@
61
58
now specify a Poisson problem with homogeneous Dirichlet conditions, find <spanclass="math notranslate nohighlight">\(u\)</span> in
62
59
some finite element space <spanclass="math notranslate nohighlight">\(V\)</span> such that:</p>
<spanclass="eqno">(7.1)<aclass="headerlink" href="#equation-poisson" title="Permalink to this equation">¶</a></span>\[ \begin{align}\begin{aligned}-\nabla^2 u = f\\u = 0 \textrm{ on }\Gamma\end{aligned}\end{align} \]</div>
61
+
<spanclass="eqno">(7.1)<aclass="headerlink" href="#equation-poisson" title="Link to this equation">¶</a></span>\[ \begin{align}\begin{aligned}-\nabla^2 u = f\\u = 0 \textrm{ on }\Gamma\end{aligned}\end{align} \]</div>
65
62
<p>In order to implement the Dirichlet conditions, we need to decompose
66
63
<spanclass="math notranslate nohighlight">\(V\)</span> into two parts:</p>
<spanclass="eqno">(7.2)<aclass="headerlink" href="#equation-7-boundary-conditions-0" title="Permalink to this equation">¶</a></span>\[V = V_0 \oplus V_\Gamma\]</div>
65
+
<spanclass="eqno">(7.2)<aclass="headerlink" href="#equation-7-boundary-conditions-0" title="Link to this equation">¶</a></span>\[V = V_0 \oplus V_\Gamma\]</div>
69
66
<p>where <spanclass="math notranslate nohighlight">\(V_\Gamma\)</span> is the space spanned by those functions in the basis
70
67
of <spanclass="math notranslate nohighlight">\(V\)</span> which are non-zero on <spanclass="math notranslate nohighlight">\(\Gamma\)</span>, and <spanclass="math notranslate nohighlight">\(V_0\)</span> is the space spanned
71
68
by the remaining basis functions (i.e. those basis functions which
@@ -76,7 +73,7 @@
76
73
<p>We now write the weak form of <aclass="reference internal" href="#equation-poisson">(7.1)</a>, find <spanclass="math notranslate nohighlight">\(u=u_0 + u_\Gamma\)</span>
77
74
with <spanclass="math notranslate nohighlight">\(u_0 \in V_0\)</span> and <spanclass="math notranslate nohighlight">\(u_\Gamma \in V_\Gamma\)</span> such that:</p>
<spanclass="eqno">(7.3)<aclass="headerlink" href="#equation-7-boundary-conditions-1" title="Permalink to this equation">¶</a></span>\[ \begin{align}\begin{aligned}\int_\Omega \nabla v_0 \cdot \nabla (u_0+u_\Gamma) \, \mathrm{d} x
76
+
<spanclass="eqno">(7.3)<aclass="headerlink" href="#equation-7-boundary-conditions-1" title="Link to this equation">¶</a></span>\[ \begin{align}\begin{aligned}\int_\Omega \nabla v_0 \cdot \nabla (u_0+u_\Gamma) \, \mathrm{d} x
<spanclass="eqno">(7.4)<aclass="headerlink" href="#equation-weakpoisson" title="Permalink to this equation">¶</a></span>\[ \begin{align}\begin{aligned}\int_\Omega \nabla v_0 \cdot \nabla u \, \mathrm{d} x
93
+
<spanclass="eqno">(7.4)<aclass="headerlink" href="#equation-weakpoisson" title="Link to this equation">¶</a></span>\[ \begin{align}\begin{aligned}\int_\Omega \nabla v_0 \cdot \nabla u \, \mathrm{d} x
<h2><spanclass="section-number">7.1. </span>An algorithm for homogeneous Dirichlet conditions<aclass="headerlink" href="#an-algorithm-for-homogeneous-dirichlet-conditions" title="Permalink to this headline">¶</a></h2>
97
+
<h2><spanclass="section-number">7.1. </span>An algorithm for homogeneous Dirichlet conditions<aclass="headerlink" href="#an-algorithm-for-homogeneous-dirichlet-conditions" title="Link to this heading">¶</a></h2>
101
98
<p>The implementation of homogeneous Dirichlet conditions is actually
<h2><spanclass="section-number">7.2. </span>Implementing boundary conditions<aclass="headerlink" href="#implementing-boundary-conditions" title="Permalink to this headline">¶</a></h2>
120
+
<h2><spanclass="section-number">7.2. </span>Implementing boundary conditions<aclass="headerlink" href="#implementing-boundary-conditions" title="Link to this heading">¶</a></h2>
function. You should base your implementation on your
139
136
<codeclass="docutils literal notranslate"><spanclass="pre">fe_utils/solvers/helmholtz.py</span></code> but take into account the difference
140
137
in the equation, and the boundary conditions. The
141
-
<codeclass="xref py py-func docutils literal notranslate"><spanclass="pre">fe_utils.solvers.poisson.boundary_nodes()</span></code> function in <codeclass="docutils literal notranslate"><spanclass="pre">fe_utils/solvers/poisson.py</span></code> is
138
+
<aclass="reference internal" href="fe_utils.solvers.html#fe_utils.solvers.poisson.boundary_nodes" title="fe_utils.solvers.poisson.boundary_nodes"><codeclass="xref py py-func docutils literal notranslate"><spanclass="pre">fe_utils.solvers.poisson.boundary_nodes()</span></code></a> function in <codeclass="docutils literal notranslate"><spanclass="pre">fe_utils/solvers/poisson.py</span></code> is
142
139
likely to be helpful in implementing the boundary conditions. As
<h2><spanclass="section-number">7.3. </span>Inhomogeneous Dirichlet conditions<aclass="headerlink" href="#inhomogeneous-dirichlet-conditions" title="Permalink to this headline">¶</a></h2>
150
+
<h2><spanclass="section-number">7.3. </span>Inhomogeneous Dirichlet conditions<aclass="headerlink" href="#inhomogeneous-dirichlet-conditions" title="Link to this heading">¶</a></h2>
154
151
<p>The algorithm described here can be extended to inhomogeneous systems
155
152
by setting the entries in the global vector to the value of the
156
153
boundary condition at the corresponding boundary node. This additional
0 commit comments