<!DOCTYPE html><html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<div class="markdown-here-wrapper" data-md-url="" style="" markdown-here-wrapper-content-modified="true">
<p style="margin: 0px 0px 1.2em !important;">Dear toolkit
community,</p>
<p style="margin: 0px 0px 1.2em !important;"><br>
</p>
<p style="margin: 0px 0px 1.2em !important;">I’m struggling to
find a way to plot a 1D quantity in Kuibit without merging the
different meshes originated from the mesh refinement.</p>
<p style="margin: 0px 0px 1.2em !important;">As a workaround, I
have made a Python script that reads the file of a grid function
and plots every point along the axis and its corresponding
value. I can share this script if somebody is interested, but it
is not very good as it breaks once you use checkpoints and has
hardcoded paths. </p>
<p style="margin: 0px 0px 1.2em !important;">However, it gets the
job done, as you can see in an example plot below, where it is
hopefully obvious that there is an increase in the number of
points as z approaches 0.</p>
<img src="https://i.imgur.com/o0Ke1oi.png" width="454" height="431">
<p style="margin: 0px 0px 1.2em !important;">Obviously, a solution
that uses Kuibit would be much better. However, I cannot come up
with such a solution and so I’m writing this e-mail.</p>
<p style="margin: 0px 0px 1.2em !important;"><br>
</p>
<p style="margin: 0px 0px 1.2em !important;">From the
documentation, the object that represents the simulation data
(including the mesh refinement levels), is the <code style="font-family: Consolas, Inconsolata, Courier, monospace;margin: 0px 0.15em; padding: 0px 0.3em; white-space: pre-wrap; font-weight: 550; background-color: rgba(119, 119, 119, 0.3); border-radius: 3px; display: inline;">HierarchicalGridData</code>,
and I know how to go from a grid function to this object.</p>
<p style="margin: 0px 0px 1.2em !important;">For instance, to get
the <code style="font-family: Consolas, Inconsolata, Courier, monospace;margin: 0px 0.15em; padding: 0px 0.3em; white-space: pre-wrap; font-weight: 550; background-color: rgba(119, 119, 119, 0.3); border-radius: 3px; display: inline;">HierarchicalGridData</code>
that represents the real part of a scalar field along the x-axis
at t=0, we do</p>
<pre style="font-family: Consolas, Inconsolata, Courier, monospace;font-size: 1em; line-height: 1.2em;margin: 1.2em 0px;"><code class="hljs language-python" style="font-family: Consolas, Inconsolata, Courier, monospace;margin: 0px 0.15em; padding: 0px 0.3em; white-space: pre-wrap; font-weight: 550; background-color: rgba(119, 119, 119, 0.3); border-radius: 3px; display: inline;white-space: pre; overflow: auto; border-radius: 3px; border: 1px solid rgb(204, 204, 204); padding: 0.5em 0.7em; display: block !important;background: rgb(255, 255, 255); color: rgb(0, 0, 0);">sd = SimDir(<span class="hljs-string" style="font-weight: normal;color: rgb(0, 0, 255);">"<output>"</span>)
gf = sd.gf
phi1=gf.x[<span class="hljs-string" style="font-weight: normal;color: rgb(0, 0, 255);">"phi1"</span>].get_time(<span class="hljs-number" style="color: rgb(0, 0, 255);">0</span>)
</code></pre>
<p style="margin: 0px 0px 1.2em !important;">All I have to do now
is plot this somehow. As it turns out, this is impossible,
because according to the documentation</p>
<blockquote style="margin: 1.2em 0px;border-left: 4px solid rgb(51, 117, 221); padding: 0px 1em; color: rgb(119, 119, 119); quotes: none;">
<p style="margin: 0px 0px 1.2em !important;">We cannot plot
directly this object, because it is a complicated object. To
plot it, we have to merge the refinement levels to a single <code style="font-family: Consolas, Inconsolata, Courier, monospace;margin: 0px 0.15em; padding: 0px 0.3em; white-space: pre-wrap; font-weight: 550; background-color: rgba(119, 119, 119, 0.3); border-radius: 3px; display: inline;">UniformGridData</code>.
We can do this with <code style="font-family: Consolas, Inconsolata, Courier, monospace;margin: 0px 0.15em; padding: 0px 0.3em; white-space: pre-wrap; font-weight: 550; background-color: rgba(119, 119, 119, 0.3); border-radius: 3px; display: inline;">refinement_levels_merged()</code>.</p>
</blockquote>
<p style="margin: 0px 0px 1.2em !important;">But, all of the
information regarding the mesh refinement levels is here, so it
should be possible to extract this information and plot it,
right?</p>
<p style="margin: 0px 0px 1.2em !important;">Looking at the
methods and variables in <code style="font-family: Consolas, Inconsolata, Courier, monospace;margin: 0px 0.15em; padding: 0px 0.3em; white-space: pre-wrap; font-weight: 550; background-color: rgba(119, 119, 119, 0.3); border-radius: 3px; display: inline;">HierarchicalGridData</code>
I came up with nothing.</p>
<p style="margin: 0px 0px 1.2em !important;">Does anybody have a
solution to this?</p>
<p style="margin: 0px 0px 1.2em !important;"><br>
</p>
<p style="margin: 0px 0px 1.2em !important;">Thank you in advance,</p>
<p style="margin: 0px 0px 1.2em !important;">Best Regards,</p>
<p style="margin: 0px 0px 1.2em !important;">José Ferreira</p>
<p style="margin: 0px 0px 1.2em !important;"><br>
</p>
<div title="MDH:PHA+RGVhciB0b29sa2l0IGNvbW11bml0eSw8L3A+PHA+PGJyPjwvcD48cD5JJ20gc3RydWdnbGlu
ZyB0byBmaW5kIGEgd2F5IHRvIHBsb3QgYSAxRCBxdWFudGl0eSBpbiBLdWliaXQgd2l0aG91dCBt
ZXJnaW5nIHRoZSBkaWZmZXJlbnQgbWVzaGVzIG9yaWdpbmF0ZWQgZnJvbSB0aGUgbWVzaCByZWZp
bmVtZW50LjwvcD48cD5BcyBhIHdvcmthcm91bmQsIEkgaGF2ZSBtYWRlIGEgUHl0aG9uIHNjcmlw
dCB0aGF0IHJlYWRzIHRoZSBmaWxlIG9mIGEgZ3JpZCBmdW5jdGlvbiBhbmQgcGxvdHMgZXZlcnkg
cG9pbnQgYWxvbmcgdGhlIGF4aXMgYW5kIGl0cyBjb3JyZXNwb25kaW5nIHZhbHVlLiBJIGNhbiBz
aGFyZSB0aGlzIHNjcmlwdCBpZiBzb21lYm9keSBpcyBpbnRlcmVzdGVkLCBidXQgaXQgaXMgbm90
IHZlcnkgZ29vZCBhcyBpdCBicmVha3Mgb25jZSB5b3UgdXNlIGNoZWNrcG9pbnRzIGFuZCBoYXMg
aGFyZGNvZGVkIHBhdGhzLiZuYnNwOzwvcD48cD5Ib3dldmVyLCBpdCBnZXRzIHRoZSBqb2IgZG9u
ZSwgYXMgeW91IGNhbiBzZWUgaW4gYW4gZXhhbXBsZSBwbG90IGJlbG93LCB3aGVyZSBpdCBpcyBo
b3BlZnVsbHkgb2J2aW91cyB0aGF0IHRoZXJlIGlzIGFuIGluY3JlYXNlIGluIHRoZSBudW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QsIHRoaXMg
aXMgaW1wb3NzaWJsZSwgYmVjYXVzZSBhY2NvcmRpbmcgdG8gdGhlIGRvY3VtZW50YXRpb248YnI+
PC9wPjxwPiZndDsgV2UgY2Fubm90IHBsb3QgZGlyZWN0bHkgdGhpcyBvYmplY3QsIGJlY2F1c2Ug
aXQgaXMgYSBjb21wbGljYXRlZCBvYmplY3QuIFRvIHBsb3QgaXQsIHdlIGhhdmUgdG8gbWVyZ2Ug
dGhlIHJlZmluZW1lbnQgbGV2ZWxzIHRvIGEgc2luZ2xlIGBVbmlmb3JtR3JpZERhdGFgLiBXZSBj
YW4gZG8gdGhpcyB3aXRoIGByZWZpbmVtZW50X2xldmVsc19tZXJnZWQoKWAuPC9wPjxwPjxicj48
L3A+PHA+QnV0LCBhbGwgb2YgdGhlIGluZm9ybWF0aW9uIHJlZ2FyZGluZyB0aGUgbWVzaCByZWZp
bmVtZW50IGxldmVscyBpcyBoZXJlLCBzbyBpdCBzaG91bGQgYmUgcG9zc2libGUgdG8gZXh0cmFj
dCB0aGlzIGluZm9ybWF0aW9uIGFuZCBwbG90IGl0LCByaWdodD88L3A+PHA+TG9va2luZyBhdCB0
aGUgbWV0aG9kcyBhbmQgdmFyaWFibGVzIGluIGBIaWVyYXJjaGljYWxHcmlkRGF0YWAgSSBjYW1l
IHVwIHdpdGggbm90aGluZy48YnI+PC9wPjxwPjxicj48L3A+" aria-hidden="true" style="height:0;width:0;max-height:0;max-width:0;overflow:hidden;font-size:0;padding:0;margin:0;"></div>
</div>
</body>
</html>