<!DOCTYPE html>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p>Hi,<br>
    </p>
    <p>Thanks for pointing to the "magic pointer", or change-counter to
      identify whether it is necessary to to update some data
      structures.</p>
    <p>But, actually I wanted to know something else (I am not sure if
      this is related):</p>
    <p>Do we need to recreate the gridview after the underlying grid is
      modified? I always thought: yes, but maybe I got this somehow
      wrong.</p>
    <p>Examples:<br>
      - The gridview of Dune::UGGrid just stores a pointer to the grid
      (and potentially a level int) and redirects all calls to the grid
      -> the gridview object is valid after grid adaption<br>
      - YaspGrid implements its gridview via the DefaultGridView
      implementations that redirect everything to the grid -> the
      gridview object is valid after grid adaption<br>
      - OneDGrid is fine<br>
      - ALUGrid is fine<br>
      - Some meta-grids are a little bit more complicated to check
      since, e.g., IdGridViewBasic has an IndexSet stored in the class
      that contains a reference to the host-indexset and it needs to be
      checked whether the indexset references are valid after grid
      adaption. But, it seems so.</p>
    <p>So, my post refers actually to the question whether we should do
      anything with the gridview or not (after grid adaption) and it
      seems to me, that a gridview is perfectly valid after the
      underlying grid has changed.</p>
    <p>Did I miss something? Is this a guarantee that we can give? Are
      there counterexamples?</p>
    <p>Best,<br>
      Simon<br>
    </p>
    <div class="moz-cite-prefix">Am 10.04.25 um 21:04 schrieb Christian
      Engwer:<br>
    </div>
    <blockquote type="cite"
      cite="mid:D2E9712A-F4BD-4B93-AC1D-A2819E584FE7@uni-muenster.de">
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
      <div dir="auto">PS Ich denke ein genereller Bedarf besteht, wir
        sollten also mal über eine Lösung diskutieren...</div>
      <br>
      <br>
      <div class="gmail_quote">
        <div dir="auto">Am 10. April 2025 20:57:21 MESZ schrieb
          Christian Engwer <a class="moz-txt-link-rfc2396E" href="mailto:christian.engwer@uni-muenster.de"><christian.engwer@uni-muenster.de></a>:</div>
        <blockquote class="gmail_quote"
style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
          <div dir="auto">Deswegen gibt es den magischen Pointer den
            Robert aufs Gitter packen möchte, damit er dort eine Liste
            pflegen kann, welche Objekte alle aktualisiert werden
            müssen, wenn sich das Gitter ändert.<br>
            <br>
            Ciao Christian</div>
          <br>
          <br>
          <div class="gmail_quote">
            <div dir="auto">Am 10. April 2025 18:19:52 MESZ schrieb
              Simon Praetorius <a class="moz-txt-link-rfc2396E" href="mailto:simon.praetorius@tu-dresden.de"><simon.praetorius@tu-dresden.de></a>:</div>
            <blockquote class="gmail_quote"
style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
              <pre class="k9mail"><div dir="auto">Hi everyone,

if I have a gridview, e.g. a leaf-gridview, of some grid and I modify the grid, e.g., do some grid adaption, what is the state of the gridview after this modification? What can we do with a gridview after the modification? As far as I was know (maybe this is documented somewhere), essentially the gridview is invalid, except for the reference to the grid. Is this statement correct?

Background to this question: Often I have stored just a gridview, in my application most of the time just the leaf gridview. If the underlying grid changes, how can I generate an updated gridview for these classes? The gridview does not know what kind of gridview it is and how it was constructed. Thus, it cannot request an update of itself. Examples of such classes that need to update their gridview are the MCMGMapper in dune-grid, the VtkWriter from dune-vtk, the global basis from dune-functions, and probably a lot more.

Several grids have gridviews that stay valid after grid modifications, e.g. those implemented with a GridDefaultImplementation using DefaultGridViewTraits. Is this, by chance, true for all grid managers? In which grid managers an operation on an invalidated gridview would fail (and why)?

Best,
Simon

</div></pre>
            </blockquote>
          </div>
        </blockquote>
      </div>
      <br>
      <fieldset class="moz-mime-attachment-header"></fieldset>
      <pre wrap="" class="moz-quote-pre">_______________________________________________
Dune-devel mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Dune-devel@lists.dune-project.org">Dune-devel@lists.dune-project.org</a>
<a class="moz-txt-link-freetext" href="https://lists.dune-project.org/mailman/listinfo/dune-devel">https://lists.dune-project.org/mailman/listinfo/dune-devel</a>
</pre>
    </blockquote>
  </body>
</html>