<div dir="ltr"><div dir="ltr">On Wed, Nov 8, 2023 at 2:40 PM Brandon Denton via petsc-users <<a href="mailto:petsc-users@mcs.anl.gov">petsc-users@mcs.anl.gov</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="msg-2214176627919871346">
<div dir="ltr">
<div style="direction:ltr">Good Afternoon,</div>
<div style="direction:ltr"><br>
</div>
<div style="direction:ltr">Is there a structure within PETSc that allows storage of a value using a triple similar to PetscHMapIJSet with the key using a struct{PetscScalar i, j, k;}? </div>
<div style="direction:ltr"><br>
</div>
<div style="direction:ltr">I'm trying to access mesh information (the shape function coefficients I will calculate prior to their use) who's values I want to store in the auxiliary array available in the Residual Functions of PETSc's
FEM infrastructure. After some trial and error work, I've come to the realization that the coordinates (x[]) available in the auxiliary functions is the centroid of the cell/element currently being evaluated. This triplet is unique for each cell/element for
a valid mesh so I think it's reasonable to use this triplet as a key for looking up stored values unique to each cell/element. My plan is to attached the map to the Application Context, also available to Auxiliary Functions, to enable these calculations.</div>
<div style="direction:ltr"><br>
</div>
<div style="direction:ltr">Does such a map infrastructure exist within PETSc? If so, could you point me to a reference for it? If not, does anyone have any suggestions on how to solve this problem?</div></div></div></blockquote><div><br></div><div>As Jed says, this is a spatial hash. I have a primitive spatial hash now. You can use DMLocatePoints() to find the cell containing a point (like the centroid). Let me know if this does not work or if I misunderstand the problem.</div><div><br></div><div> Thanks!</div><div><br></div><div> Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="msg-2214176627919871346"><div dir="ltr">
<div style="direction:ltr">Thank you in advance for your time.</div>
<div style="direction:ltr">Brandon Denton</div>
<div style="direction:ltr"><br>
</div>
</div>
</div></blockquote></div><br clear="all"><div><br></div><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div>What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>-- Norbert Wiener</div><div><br></div><div><a href="http://www.cse.buffalo.edu/~knepley/" target="_blank">https://www.cse.buffalo.edu/~knepley/</a><br></div></div></div></div></div></div></div></div>