<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://e6.ijs.si/index.php?action=history&amp;feed=atom&amp;title=NURBS_domains</id>
	<title>NURBS domains - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://e6.ijs.si/index.php?action=history&amp;feed=atom&amp;title=NURBS_domains"/>
	<link rel="alternate" type="text/html" href="https://e6.ijs.si/medusa/wiki/index.php?title=NURBS_domains&amp;action=history"/>
	<updated>2026-11-12T03:06:22Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.11</generator>
	<entry>
		<id>https://e6.ijs.si/medusa/wiki/index.php?title=NURBS_domains&amp;diff=3043&amp;oldid=prev</id>
		<title>Uduh at 11:32, 1 September 2020</title>
		<link rel="alternate" type="text/html" href="https://e6.ijs.si/medusa/wiki/index.php?title=NURBS_domains&amp;diff=3043&amp;oldid=prev"/>
		<updated>2020-09-01T11:32:02Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 11:32, 1 September 2020&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l15&quot;&gt;Line 15:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 15:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;where $\Omega$ is the interior of a NURBS curve defined piecewise. In this case, we will use a duck shaped curve composed of $8$ NURBS curve patches.  &lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;where $\Omega$ is the interior of a NURBS curve defined piecewise. In this case, we will use a duck shaped curve composed of $8$ NURBS curve patches.  &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;In Medusa, we represent NURBS patches as instances of &amp;lt;code&amp;gt;NURBSPatch&amp;lt;vec_t, param_vec_t&amp;gt;&amp;lt;/code&amp;gt; class, where &amp;lt;code&amp;gt;vec_t&amp;lt;/code&amp;gt; is the vector type of the ambient space (in this case &amp;lt;code&amp;gt;Vec2d&amp;lt;/code&amp;gt;) and &amp;lt;code&amp;gt;param_vec_t&amp;lt;/code&amp;gt; is the vector type of the parametric space (&amp;lt;code&amp;gt;Vec1d&amp;lt;/code&amp;gt; for curves and &amp;lt;code&amp;gt;Vec2d&amp;lt;/code&amp;gt; for surfaces). To construct an instance, its control points, weights, knot vector, and order $p$ must be given. In this case, we have a simple knot vector &amp;lt;code&amp;gt;{0, 0, 0, 0, 1, 1, 1, 1}&amp;lt;/code&amp;gt;, all weights equal to $1$ and $p = 3$ (this means that our curves are Bézier curves). Control points will be calculated from &amp;lt;code&amp;gt;pts&amp;lt;/code&amp;gt;. We will push all patches into one &amp;lt;code&amp;gt;Range&amp;lt;/code&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;In Medusa, we represent NURBS patches as instances of &amp;lt;code&amp;gt;NURBSPatch&amp;lt;vec_t, param_vec_t&amp;gt;&amp;lt;/code&amp;gt; class, where &amp;lt;code&amp;gt;vec_t&amp;lt;/code&amp;gt; is the vector type of the ambient space (in this case &amp;lt;code&amp;gt;Vec2d&amp;lt;/code&amp;gt;) and &amp;lt;code&amp;gt;param_vec_t&amp;lt;/code&amp;gt; is the vector type of the parametric space (&amp;lt;code&amp;gt;Vec1d&amp;lt;/code&amp;gt; for curves and &amp;lt;code&amp;gt;Vec2d&amp;lt;/code&amp;gt; for surfaces). To construct an instance, its control points, weights, knot vector, and order $p$ must be given. In this case, we have a simple knot vector &amp;lt;code&amp;gt;{0, 0, 0, 0, 1, 1, 1, 1}&amp;lt;/code&amp;gt;, all weights equal to $1$ and $p = 3$ (this means that our curves are Bézier curves). Control points will be calculated from &amp;lt;code&amp;gt;pts&amp;lt;/code&amp;gt;. We will push all patches into one &amp;lt;code&amp;gt;Range&amp;lt;/code&amp;gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;// Points to be used in NURBS creation.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;// Points to be used in NURBS creation.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l95&quot;&gt;Line 95:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 95:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Here is the plot of $u(x, y)$.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Here is the plot of $u(x, y)$.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;TODO!!&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[File:duck_pde.png|800px]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The whole example can be found as [https://gitlab.com/e62Lab/medusa/-/blob/dev/examples/poisson_equation poisson_NURBS_2D.cpp] along with the plot script that can be run by Matlab or Octave [https://gitlab.com/e62Lab/medusa/-/blob/dev/examples/poisson_equation poisson_NURBS_2D_2D.m].&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The whole example can be found as [https://gitlab.com/e62Lab/medusa/-/blob/dev/examples/poisson_equation poisson_NURBS_2D.cpp] along with the plot script that can be run by Matlab or Octave [https://gitlab.com/e62Lab/medusa/-/blob/dev/examples/poisson_equation poisson_NURBS_2D_2D.m].&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Uduh</name></author>
	</entry>
	<entry>
		<id>https://e6.ijs.si/medusa/wiki/index.php?title=NURBS_domains&amp;diff=3041&amp;oldid=prev</id>
		<title>Uduh: Created page with &quot;Go back to Examples.  Medusa supports filling domains bounded by non-uniform rational basis splines ([https://en.wikipedia.org/wiki/Non-uniform_rational_B-...&quot;</title>
		<link rel="alternate" type="text/html" href="https://e6.ijs.si/medusa/wiki/index.php?title=NURBS_domains&amp;diff=3041&amp;oldid=prev"/>
		<updated>2020-09-01T11:26:46Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;Go back to &lt;a href=&quot;/medusa/wiki/index.php?title=Medusa#Examples&quot; title=&quot;Medusa&quot;&gt;Examples&lt;/a&gt;.  Medusa supports filling domains bounded by non-uniform rational basis splines ([https://en.wikipedia.org/wiki/Non-uniform_rational_B-...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Go back to [[Medusa#Examples|Examples]].&lt;br /&gt;
&lt;br /&gt;
Medusa supports filling domains bounded by non-uniform rational basis splines ([https://en.wikipedia.org/wiki/Non-uniform_rational_B-spline, NURBS]) curves and NURBS surfaces obtained as the tensor product of two NURBS curves. Note that [https://en.wikipedia.org/wiki/B%C3%A9zier_curve Bézier curves] and [https://en.wikipedia.org/wiki/B-spline B-splines] are special cases of NURBS curves.&lt;br /&gt;
&lt;br /&gt;
See [[Positioning of computational nodes]] for details on node positioning algorithms.&lt;br /&gt;
&lt;br /&gt;
== Poisson equation with Dirichlet boundary conditions in 2D ==&lt;br /&gt;
With Medusa, we can also solve partial differential equations on NURBS domains. Consider the solution of a simple 2D Poisson equation with Dirichlet boundary conditions:&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align*}&lt;br /&gt;
    	\Delta u &amp;amp;= 20      &amp;amp;&amp;amp;\text{in } \Omega, \\&lt;br /&gt;
    	  u &amp;amp;= 0           &amp;amp;&amp;amp;\text{on } \partial \Omega,&lt;br /&gt;
\end{align*}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
where $\Omega$ is the interior of a NURBS curve defined piecewise. In this case, we will use a duck shaped curve composed of $8$ NURBS curve patches. &lt;br /&gt;
&lt;br /&gt;
In Medusa, we represent NURBS patches as instances of &amp;lt;code&amp;gt;NURBSPatch&amp;lt;vec_t, param_vec_t&amp;gt;&amp;lt;/code&amp;gt; class, where &amp;lt;code&amp;gt;vec_t&amp;lt;/code&amp;gt; is the vector type of the ambient space (in this case &amp;lt;code&amp;gt;Vec2d&amp;lt;/code&amp;gt;) and &amp;lt;code&amp;gt;param_vec_t&amp;lt;/code&amp;gt; is the vector type of the parametric space (&amp;lt;code&amp;gt;Vec1d&amp;lt;/code&amp;gt; for curves and &amp;lt;code&amp;gt;Vec2d&amp;lt;/code&amp;gt; for surfaces). To construct an instance, its control points, weights, knot vector, and order $p$ must be given. In this case, we have a simple knot vector &amp;lt;code&amp;gt;{0, 0, 0, 0, 1, 1, 1, 1}&amp;lt;/code&amp;gt;, all weights equal to $1$ and $p = 3$ (this means that our curves are Bézier curves). Control points will be calculated from &amp;lt;code&amp;gt;pts&amp;lt;/code&amp;gt;. We will push all patches into one &amp;lt;code&amp;gt;Range&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
// Points to be used in NURBS creation.&lt;br /&gt;
Range&amp;lt;Vec2d&amp;gt; pts{{210, -132.5}, {205, -115}, {125, -35}, {85, -61}, {85, -61}, {85, -61},&lt;br /&gt;
                 {80, -65}, {75, -58}, {75, -58}, {65, 45}, {25, 25}, {-15, -16}, {-15, -16},&lt;br /&gt;
                 {-15, -16}, {-35, -28}, {-40, -32.375}, {-40, -32.375}, {-43, -35}, {-27, -40},&lt;br /&gt;
                 {-5, -40}, {-5, -40}, {50, -38}, {35, -65}, {15, -75}, {15, -75}, {-15, -95},&lt;br /&gt;
                 {-20, -140}, {45, -146}, {45, -146}, {95, -150}, {215, -150}, {210, -132.5}};&lt;br /&gt;
&lt;br /&gt;
// Calculate NURBS patches&amp;#039; control points, weights, knot vector and order.&lt;br /&gt;
int p = 3;&lt;br /&gt;
Range&amp;lt;double&amp;gt; weights{1, 1, 1, 1};&lt;br /&gt;
Range&amp;lt;double&amp;gt; knot_vector{0, 0, 0, 0, 1, 1, 1, 1};&lt;br /&gt;
Range&amp;lt;NURBSPatch&amp;lt;Vec2d, Vec1d&amp;gt;&amp;gt; patches;&lt;br /&gt;
&lt;br /&gt;
for (int i = 0; i &amp;lt; 8; i++) {&lt;br /&gt;
    Range&amp;lt;Vec2d&amp;gt; control_points;&lt;br /&gt;
    for (int j = 0; j &amp;lt; 4; j++) {&lt;br /&gt;
        control_points.push_back(pts[4 * i + j]);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    NURBSPatch&amp;lt;Vec2d, Vec1d&amp;gt; patch(control_points, weights, {knot_vector}, {p});&lt;br /&gt;
    patches.push_back(patch);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now, we can construct a &amp;lt;code&amp;gt;NURBSShape&amp;lt;vec_t, param_vec_t&amp;gt;&amp;lt;/code&amp;gt; representing our NURBS curve from a &amp;lt;code&amp;gt;Range&amp;lt;/code&amp;gt; of patches and fill it according to the spacing $h$. Spacing can also be given in the form of a spacing function, see [[Parametric domains]].&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
// Create NURBS shape from a range of patches.&lt;br /&gt;
NURBSShape&amp;lt;Vec2d, Vec1d&amp;gt; shape(patches);&lt;br /&gt;
&lt;br /&gt;
// Fill the domain.&lt;br /&gt;
double h = 0.5;&lt;br /&gt;
DomainDiscretization&amp;lt;Vec2d&amp;gt; domain = shape.discretizeBoundaryWithStep(h);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After that, we can fill the interior of the domain in the usual way.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
GeneralFill&amp;lt;Vec2d&amp;gt; gf;&lt;br /&gt;
gf(domain, h);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally, we translate the partial differential equations of our problem into code and solve the problem, as in other examples.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
// Construct the approximation engine.&lt;br /&gt;
int m = 2;  // basis order&lt;br /&gt;
Monomials&amp;lt;Vec2d&amp;gt; mon(m);&lt;br /&gt;
RBFFD&amp;lt;Polyharmonic&amp;lt;double, 3&amp;gt;, Vec2d&amp;gt; approx({}, mon);&lt;br /&gt;
&lt;br /&gt;
// Find support for the nodes.&lt;br /&gt;
int N = domain.size();&lt;br /&gt;
domain.findSupport(FindClosest(mon.size()));&lt;br /&gt;
&lt;br /&gt;
// Compute the shapes (we only need the Laplacian).&lt;br /&gt;
auto storage = domain.computeShapes&amp;lt;sh::lap&amp;gt;(approx);&lt;br /&gt;
&lt;br /&gt;
Eigen::SparseMatrix&amp;lt;double, Eigen::RowMajor&amp;gt; M(N, N);&lt;br /&gt;
Eigen::VectorXd rhs(N);&lt;br /&gt;
rhs.setZero();&lt;br /&gt;
M.reserve(storage.supportSizes());&lt;br /&gt;
&lt;br /&gt;
// Construct implicit operators over our storage.&lt;br /&gt;
auto op = storage.implicitOperators(M, rhs);&lt;br /&gt;
&lt;br /&gt;
for (int i : domain.interior()) {&lt;br /&gt;
    // set the case for nodes in the domain&lt;br /&gt;
    op.lap(i) = 20.0;&lt;br /&gt;
}&lt;br /&gt;
for (int i : domain.boundary()) {&lt;br /&gt;
    // enforce the boundary conditions&lt;br /&gt;
    op.value(i) = 0.0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
Eigen::BiCGSTAB&amp;lt;decltype(M), Eigen::IncompleteLUT&amp;lt;double&amp;gt;&amp;gt; solver;&lt;br /&gt;
solver.compute(M);&lt;br /&gt;
ScalarFieldd u = solver.solve(rhs);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here is the plot of $u(x, y)$.&lt;br /&gt;
&lt;br /&gt;
TODO!!&lt;br /&gt;
&lt;br /&gt;
The whole example can be found as [https://gitlab.com/e62Lab/medusa/-/blob/dev/examples/poisson_equation poisson_NURBS_2D.cpp] along with the plot script that can be run by Matlab or Octave [https://gitlab.com/e62Lab/medusa/-/blob/dev/examples/poisson_equation poisson_NURBS_2D_2D.m].&lt;/div&gt;</summary>
		<author><name>Uduh</name></author>
	</entry>
</feed>