<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="overflow-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;">
<div>Now the error is in the call to <span style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);">DMSwarmMigrate</span><font color="#000000"><span style="caret-color: rgb(0, 0, 0);"> </span></font></div>
<div><font color="#000000"><span style="caret-color: rgb(0, 0, 0);"><br>
</span></font></div>
<div><font color="#000000"><span style="caret-color: rgb(0, 0, 0);">Miguel</span></font></div>
<div><br>
</div>
<div>[0]PETSC ERROR: ------------------------------------------------------------------------</div>
<div>[0]PETSC ERROR: Caught signal number 11 SEGV: Segmentation Violation, probably memory access out of range</div>
<div>[0]PETSC ERROR: Try option -start_in_debugger or -on_error_attach_debugger</div>
<div>[0]PETSC ERROR: or see <a href="https://urldefense.us/v3/__https://petsc.org/release/faq/*valgrind__;Iw!!G_uCfscf7eWS!ad4_CYmqVLwmuIANP7o2NXvoqCPGFSZpW_gVLp8pQweudrYWPdqW4De1CaYkE5a1sPrs7JUO_n5fznRPbEaqpg$">https://petsc.org/release/faq/#valgrind</a> and <a href="https://urldefense.us/v3/__https://petsc.org/release/faq/__;!!G_uCfscf7eWS!ad4_CYmqVLwmuIANP7o2NXvoqCPGFSZpW_gVLp8pQweudrYWPdqW4De1CaYkE5a1sPrs7JUO_n5fznTEGnkpAg$">https://petsc.org/release/faq/</a></div>
<div>[0]PETSC ERROR: --------------------- Stack Frames ------------------------------------</div>
<div>[0]PETSC ERROR: The line numbers in the error traceback are not always exact.</div>
<div>[0]PETSC ERROR: #1 DMSwarmDataBucketGetSizes() at /Users/migmolper/petsc/src/dm/impls/swarm/data_bucket.c:297</div>
<div>[0]PETSC ERROR: #2 DMSwarmMigrate_CellDMScatter() at /Users/migmolper/petsc/src/dm/impls/swarm/swarm_migrate.c:201</div>
<div>[0]PETSC ERROR: #3 DMSwarmMigrate() at /Users/migmolper/petsc/src/dm/impls/swarm/swarm.c:1349</div>
<div>[0]PETSC ERROR: #4 main() at /Users/migmolper/DMD/driver-tasting-SOLERA.cpp:41</div>
<div>application called MPI_Abort(MPI_COMM_WORLD, 59) - process 0</div>
<div><br>
<blockquote type="cite">
<div>On Jan 17, 2025, at 4:22 PM, Matthew Knepley <knepley@gmail.com> wrote:</div>
<br class="Apple-interchange-newline">
<div>
<div dir="ltr" style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;">
<div dir="ltr">On Fri, Jan 17, 2025 at 10:08 AM MIGUEL MOLINOS PEREZ <<a href="mailto:mmolinos@us.es">mmolinos@us.es</a>> wrote:<br>
</div>
<div class="gmail_quote gmail_quote_container">
<blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex;">
<div>
<div>Thank you Matt, this the piece of code I use to change the coordinates of the DM obtained using:</div>
</div>
</blockquote>
<div><br>
</div>
<div>You do not need the call to DMSetCoordinates(). What happens when you remove it?</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-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex;">
<div>
<div><br>
</div>
<div>
<div style="color: rgb(212, 212, 212); background-color: rgb(30, 30, 30); font-family: Menlo, Monaco, "Courier New", monospace; line-height: 18px; white-space: pre-wrap;">
<div><span style="color: rgb(220, 220, 170);">DMSwarmGetCellDM</span>(<span style="color: rgb(156, 220, 254);">Simulation</span>.<span style="color: rgb(156, 220, 254);">atomistic_data</span>, &<span style="color: rgb(156, 220, 254);">bounding_cell</span>);</div>
<div><span style="color: rgb(220, 220, 170);">DMGetApplicationContext</span>(<span style="color: rgb(156, 220, 254);">bounding_cell</span>, &<span style="color: rgb(156, 220, 254);">background_mesh</span>);</div>
</div>
</div>
<div><br>
</div>
<div>Thanks,</div>
<div>Miguel</div>
<div><br>
</div>
<div style="background-color: rgb(30, 30, 30); font-family: Menlo, Monaco, "Courier New", monospace; line-height: 18px; white-space: pre-wrap;">
<div style="color: rgb(212, 212, 212);"><span style="color: rgb(106, 153, 85);">/************************************************************************/</span></div>
<font color="#d4d4d4"><br>
</font>
<div style="color: rgb(212, 212, 212);"><span style="color: rgb(78, 201, 176);">PetscErrorCode</span>
<span style="color: rgb(220, 220, 170);">Volumetric_Expansion</span>(<span style="color: rgb(78, 201, 176);">DM</span>
<span style="color: rgb(156, 220, 254);">dm</span>, <span style="color: rgb(86, 156, 214);">
const</span> <span style="color: rgb(78, 201, 176);">Eigen</span>::<span style="color: rgb(78, 201, 176);">Matrix3d</span><span style="color: rgb(86, 156, 214);">&</span>
<span style="color: rgb(156, 220, 254);">F</span>) {</div>
<div style="color: rgb(212, 212, 212);"><span style="color: rgb(78, 201, 176);">PetscErrorCode</span>
<span style="color: rgb(156, 220, 254);">ierr</span>;</div>
<div style="color: rgb(212, 212, 212);"><span style="color: rgb(78, 201, 176);">Vec</span>
<span style="color: rgb(156, 220, 254);">coordinates</span>;</div>
<div style="color: rgb(212, 212, 212);"><span style="color: rgb(78, 201, 176);">PetscScalar</span><span style="color: rgb(86, 156, 214);">*</span>
<span style="color: rgb(156, 220, 254);">coordArray</span>;</div>
<div style="color: rgb(212, 212, 212);"><span style="color: rgb(78, 201, 176);">PetscInt</span>
<span style="color: rgb(156, 220, 254);">xs</span>, <span style="color: rgb(156, 220, 254);">
ys</span>, <span style="color: rgb(156, 220, 254);">zs</span>, <span style="color: rgb(156, 220, 254);">
xm</span>, <span style="color: rgb(156, 220, 254);">ym</span>, <span style="color: rgb(156, 220, 254);">
zm</span>, <span style="color: rgb(156, 220, 254);">i</span>, <span style="color: rgb(156, 220, 254);">
j</span>, <span style="color: rgb(156, 220, 254);">k</span>;</div>
<div style="color: rgb(212, 212, 212);"><span style="color: rgb(78, 201, 176);">PetscInt</span>
<span style="color: rgb(156, 220, 254);">dim</span>, <span style="color: rgb(156, 220, 254);">
M</span>, <span style="color: rgb(156, 220, 254);">N</span>, <span style="color: rgb(156, 220, 254);">
P</span>;</div>
<font color="#d4d4d4"><br>
</font>
<div style="color: rgb(212, 212, 212);"><span style="color: rgb(156, 220, 254);">PetscFunctionBegin</span>;</div>
<div style="color: rgb(212, 212, 212);"><span style="color: rgb(106, 153, 85);">// Get DMDA information</span></div>
<div style="color: rgb(212, 212, 212);"><span style="color: rgb(156, 220, 254);">ierr</span> =
<span style="color: rgb(220, 220, 170);">DMDAGetInfo</span>(<span style="color: rgb(156, 220, 254);">dm</span>, &<span style="color: rgb(156, 220, 254);">dim</span>, &<span style="color: rgb(156, 220, 254);">M</span>, &<span style="color: rgb(156, 220, 254);">N</span>,
&<span style="color: rgb(156, 220, 254);">P</span>, <span style="color: rgb(86, 156, 214);">
NULL</span>, <span style="color: rgb(86, 156, 214);">NULL</span>, <span style="color: rgb(86, 156, 214);">
NULL</span>, <span style="color: rgb(86, 156, 214);">NULL</span>, <span style="color: rgb(86, 156, 214);">
NULL</span>, <span style="color: rgb(86, 156, 214);">NULL</span>,</div>
<div style="color: rgb(212, 212, 212);"><span style="color: rgb(86, 156, 214);">NULL</span>,
<span style="color: rgb(86, 156, 214);">NULL</span>, <span style="color: rgb(86, 156, 214);">
NULL</span>);</div>
<div style="color: rgb(212, 212, 212);"><span style="color: rgb(220, 220, 170);">CHKERRQ</span>(<span style="color: rgb(156, 220, 254);">ierr</span>);</div>
<div style="color: rgb(212, 212, 212);"><span style="color: rgb(156, 220, 254);">ierr</span> =
<span style="color: rgb(220, 220, 170);">DMDAGetCorners</span>(<span style="color: rgb(156, 220, 254);">dm</span>, &<span style="color: rgb(156, 220, 254);">xs</span>, &<span style="color: rgb(156, 220, 254);">ys</span>, &<span style="color: rgb(156, 220, 254);">zs</span>,
&<span style="color: rgb(156, 220, 254);">xm</span>, &<span style="color: rgb(156, 220, 254);">ym</span>, &<span style="color: rgb(156, 220, 254);">zm</span>);</div>
<div style="color: rgb(212, 212, 212);"><span style="color: rgb(220, 220, 170);">CHKERRQ</span>(<span style="color: rgb(156, 220, 254);">ierr</span>);</div>
<font color="#d4d4d4"><br>
</font>
<div style="color: rgb(212, 212, 212);"><span style="color: rgb(106, 153, 85);">// Get the coordinates vector</span></div>
<div style="color: rgb(212, 212, 212);"><span style="color: rgb(156, 220, 254);">ierr</span> =
<span style="color: rgb(220, 220, 170);">DMGetCoordinates</span>(<span style="color: rgb(156, 220, 254);">dm</span>, &<span style="color: rgb(156, 220, 254);">coordinates</span>);</div>
<div style="color: rgb(212, 212, 212);"><span style="color: rgb(220, 220, 170);">CHKERRQ</span>(<span style="color: rgb(156, 220, 254);">ierr</span>);</div>
<div style="color: rgb(212, 212, 212);"><span style="color: rgb(156, 220, 254);">ierr</span> =
<span style="color: rgb(220, 220, 170);">VecGetArray</span>(<span style="color: rgb(156, 220, 254);">coordinates</span>, &<span style="color: rgb(156, 220, 254);">coordArray</span>);</div>
<div style="color: rgb(212, 212, 212);"><span style="color: rgb(220, 220, 170);">CHKERRQ</span>(<span style="color: rgb(156, 220, 254);">ierr</span>);</div>
<font color="#d4d4d4"><br>
</font>
<div style="color: rgb(212, 212, 212);"><span style="color: rgb(106, 153, 85);">// Update the coordinates based on the desired transformation</span></div>
<div style="color: rgb(212, 212, 212);"><span style="color: rgb(197, 134, 192);">for</span> (<span style="color: rgb(156, 220, 254);">k</span> =
<span style="color: rgb(156, 220, 254);">zs</span>; <span style="color: rgb(156, 220, 254);">
k</span> < <span style="color: rgb(156, 220, 254);">zs</span> + <span style="color: rgb(156, 220, 254);">
zm</span>; <span style="color: rgb(156, 220, 254);">k</span>++) {</div>
<div style="color: rgb(212, 212, 212);"><span style="color: rgb(197, 134, 192);">for</span> (<span style="color: rgb(156, 220, 254);">j</span> =
<span style="color: rgb(156, 220, 254);">ys</span>; <span style="color: rgb(156, 220, 254);">
j</span> < <span style="color: rgb(156, 220, 254);">ys</span> + <span style="color: rgb(156, 220, 254);">
ym</span>; <span style="color: rgb(156, 220, 254);">j</span>++) {</div>
<div style="color: rgb(212, 212, 212);"><span style="color: rgb(197, 134, 192);">for</span> (<span style="color: rgb(156, 220, 254);">i</span> =
<span style="color: rgb(156, 220, 254);">xs</span>; <span style="color: rgb(156, 220, 254);">
i</span> < <span style="color: rgb(156, 220, 254);">xs</span> + <span style="color: rgb(156, 220, 254);">
xm</span>; <span style="color: rgb(156, 220, 254);">i</span>++) {</div>
<div style="color: rgb(212, 212, 212);"><span style="color: rgb(78, 201, 176);">PetscInt</span>
<span style="color: rgb(156, 220, 254);">idx</span> =</div>
<div style="color: rgb(212, 212, 212);">((<span style="color: rgb(156, 220, 254);">k</span> *
<span style="color: rgb(156, 220, 254);">N</span> + <span style="color: rgb(156, 220, 254);">
j</span>) * <span style="color: rgb(156, 220, 254);">M</span> + <span style="color: rgb(156, 220, 254);">
i</span>) * <span style="color: rgb(156, 220, 254);">dim</span>;<span style="color: rgb(106, 153, 85);"> // Index for the i, j, k point</span></div>
<div><font color="#d4d4d4"></font><span style="color: rgb(156, 220, 254);">coordArray</span><font color="#d4d4d4">[</font><span style="color: rgb(156, 220, 254);">idx</span><font color="#d4d4d4">] =
</font><span style="color: rgb(156, 220, 254);">coordArray</span><font color="#d4d4d4">[</font><span style="color: rgb(156, 220, 254);">idx</span><font color="#d4d4d4">] *
</font><font color="#b5cea8"><span>F(0,0)</span></font><font color="#d4d4d4">;</font><span style="color: rgb(106, 153, 85);"> // Update x-coordinate</span></div>
<div><span style="color: rgb(212, 212, 212);"><span style="color: rgb(156, 220, 254);">coordArray</span>[<span style="color: rgb(156, 220, 254);">idx</span> +
<span style="color: rgb(181, 206, 168);">1</span>] = <span style="color: rgb(156, 220, 254);">
coordArray</span>[<span style="color: rgb(156, 220, 254);">idx</span> + <span style="color: rgb(181, 206, 168);">
1</span>] * </span><font color="#b5cea8"><span>F(1,1)</span></font><font color="#d4d4d4">;</font><span style="color: rgb(106, 153, 85);"> // Update y-coordinate</span></div>
<div><span style="color: rgb(212, 212, 212);"><span style="color: rgb(156, 220, 254);">coordArray</span>[<span style="color: rgb(156, 220, 254);">idx</span> +
<span style="color: rgb(181, 206, 168);">2</span>] = <span style="color: rgb(156, 220, 254);">
coordArray</span>[<span style="color: rgb(156, 220, 254);">idx</span> + <span style="color: rgb(181, 206, 168);">
2</span>] * </span><font color="#b5cea8"><span>F(2,2)</span></font><font color="#d4d4d4">;</font><span style="color: rgb(106, 153, 85);"> // Update z-coordinate</span></div>
<div style="color: rgb(212, 212, 212);">}</div>
<div style="color: rgb(212, 212, 212);">}</div>
<div style="color: rgb(212, 212, 212);">}</div>
<font color="#d4d4d4"><br>
</font>
<div style="color: rgb(212, 212, 212);"><span style="color: rgb(106, 153, 85);">// Restore the coordinates vector</span></div>
<div style="color: rgb(212, 212, 212);"><span style="color: rgb(156, 220, 254);">ierr</span> =
<span style="color: rgb(220, 220, 170);">VecRestoreArray</span>(<span style="color: rgb(156, 220, 254);">coordinates</span>, &<span style="color: rgb(156, 220, 254);">coordArray</span>);</div>
<div style="color: rgb(212, 212, 212);"><span style="color: rgb(220, 220, 170);">CHKERRQ</span>(<span style="color: rgb(156, 220, 254);">ierr</span>);</div>
<font color="#d4d4d4"><br>
</font>
<div style="color: rgb(212, 212, 212);"><span style="color: rgb(106, 153, 85);">// Set the updated coordinates back to the DMDA</span></div>
<div style="color: rgb(212, 212, 212);"><span style="color: rgb(156, 220, 254);">ierr</span> =
<span style="color: rgb(220, 220, 170);">DMSetCoordinates</span>(<span style="color: rgb(156, 220, 254);">dm</span>,
<span style="color: rgb(156, 220, 254);">coordinates</span>);</div>
<div style="color: rgb(212, 212, 212);"><span style="color: rgb(220, 220, 170);">CHKERRQ</span>(<span style="color: rgb(156, 220, 254);">ierr</span>);</div>
<font color="#d4d4d4"><br>
</font>
<div style="color: rgb(212, 212, 212);"><span style="color: rgb(220, 220, 170);">PetscFunctionReturn</span>(<span style="color: rgb(181, 206, 168);">0</span>);</div>
<div style="color: rgb(212, 212, 212);">}</div>
<font color="#d4d4d4"><br>
</font>
<div style="color: rgb(212, 212, 212);"><span style="color: rgb(106, 153, 85);">/************************************************************************/</span></div>
</div>
<div><br>
<blockquote type="cite">
<div>On 17 Jan 2025, at 16:00, Matthew Knepley <<a href="mailto:knepley@gmail.com" target="_blank">knepley@gmail.com</a>> wrote:</div>
<br>
<div>
<div dir="ltr">
<div dir="ltr">On Fri, Jan 17, 2025 at 9:45 AM MIGUEL MOLINOS PEREZ <<a href="mailto:mmolinos@us.es" target="_blank">mmolinos@us.es</a>> wrote:<br>
</div>
<div class="gmail_quote">
<blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex;">
<div>
<div dir="auto">
<div>I tried what you suggested, but still I got this error message. Maybe I should use main release?</div>
</div>
</div>
</blockquote>
<div><br>
</div>
<div>No. I suspect something is wrong with the way you are setting coordinates. Can you share the code?</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-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex;">
<div>
<div dir="auto">
<div>Miguel</div>
<div>
<div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; text-decoration: none;">
<br>
</div>
<div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; text-decoration: none;">
<div>[4]PETSC ERROR: ------------------------------------------------------------------------</div>
<div>[4]PETSC ERROR: Caught signal number 11 SEGV: Segmentation Violation, probably memory access out of range</div>
<div>[4]PETSC ERROR: Try option -start_in_debugger or -on_error_attach_debugger</div>
<div>[4]PETSC ERROR: or see<span class="Apple-converted-space"> </span><a href="https://urldefense.us/v3/__https://petsc.org/release/faq/*valgrind__;Iw!!G_uCfscf7eWS!ad4_CYmqVLwmuIANP7o2NXvoqCPGFSZpW_gVLp8pQweudrYWPdqW4De1CaYkE5a1sPrs7JUO_n5fznRPbEaqpg$" target="_blank">https://petsc.org/release/faq/#valgrind</a><span class="Apple-converted-space"> </span>and<span class="Apple-converted-space"> </span><a href="https://urldefense.us/v3/__https://petsc.org/release/faq/__;!!G_uCfscf7eWS!ad4_CYmqVLwmuIANP7o2NXvoqCPGFSZpW_gVLp8pQweudrYWPdqW4De1CaYkE5a1sPrs7JUO_n5fznTEGnkpAg$" target="_blank">https://petsc.org/release/faq/</a></div>
<div>[4]PETSC ERROR: --------------------- Stack Frames ------------------------------------</div>
<div>[4]PETSC ERROR: The line numbers in the error traceback are not always exact.</div>
<div>[4]PETSC ERROR: #1 Pack_PetscReal_1_0() at /Users/migmolper/petsc/src/vec/is/sf/impls/basic/sfpack.c:373</div>
<div>[4]PETSC ERROR: #2 PetscSFLinkPackRootData_Private() at /Users/migmolper/petsc/src/vec/is/sf/impls/basic/sfpack.c:932</div>
<div>[4]PETSC ERROR: #3 PetscSFLinkPackRootData() at /Users/migmolper/petsc/src/vec/is/sf/impls/basic/sfpack.c:966</div>
<div>[4]PETSC ERROR: #4 PetscSFBcastBegin_Basic() at /Users/migmolper/petsc/src/vec/is/sf/impls/basic/sfbasic.c:357</div>
<div>[4]PETSC ERROR: #5 PetscSFBcastWithMemTypeBegin() at /Users/migmolper/petsc/src/vec/is/sf/interface/sf.c:1513</div>
<div>[4]PETSC ERROR: #6 VecScatterBegin_Internal() at /Users/migmolper/petsc/src/vec/is/sf/interface/vscat.c:70</div>
<div>[4]PETSC ERROR: #7 VecScatterBegin() at /Users/migmolper/petsc/src/vec/is/sf/interface/vscat.c:1316</div>
<div>[4]PETSC ERROR: #8 DMGlobalToLocalBegin_DA() at /Users/migmolper/petsc/src/dm/impls/da/dagtol.c:15</div>
<div>[4]PETSC ERROR: #9 DMGlobalToLocalBegin() at /Users/migmolper/petsc/src/dm/interface/dm.c:2844</div>
<div>[4]PETSC ERROR: #10 DMGetCoordinatesLocalSetUp() at /Users/migmolper/petsc/src/dm/interface/dmcoordinates.c:565</div>
<div>[4]PETSC ERROR: #11 DMGetCoordinatesLocal() at /Users/migmolper/petsc/src/dm/interface/dmcoordinates.c:599</div>
<div>[4]PETSC ERROR: #12 _DMLocatePoints_DMDARegular_IS() at /Users/migmolper/DMD/SOLERA/Atoms/Atom.cpp:531</div>
<div>[4]PETSC ERROR: #13 DMLocatePoints_DMDARegular() at /Users/migmolper/DMD/SOLERA/Atoms/Atom.cpp:586</div>
<div>[4]PETSC ERROR: #14 DMLocatePoints() at /Users/migmolper/petsc/src/dm/interface/dmcoordinates.c:1194</div>
<div>[4]PETSC ERROR: #15 DMSwarmMigrate_CellDMScatter() at /Users/migmolper/petsc/src/dm/impls/swarm/swarm_migrate.c:219</div>
<div>[4]PETSC ERROR: #16 DMSwarmMigrate() at /Users/migmolper/petsc/src/dm/impls/swarm/swarm.c:1349</div>
<div>[4]PETSC ERROR: #17 main() at /Users/migmolper/DMD/driver-tasting-SOLERA.cpp:41</div>
<br>
<br>
<br>
</div>
</div>
<div>
<blockquote type="cite">
<div>On Jan 15, 2025, at 4:56 PM, MIGUEL MOLINOS PEREZ <<a href="mailto:mmolinos@us.es" target="_blank">mmolinos@us.es</a>> wrote:</div>
<br>
<div>
<div>Thank you Matt for the useful info. I’ll try your idea.
<div><br>
</div>
<div>Miguel</div>
<div>
<div><br>
<blockquote type="cite">
<div>On 15 Jan 2025, at 16:48, Matthew Knepley <<a href="mailto:knepley@gmail.com" target="_blank">knepley@gmail.com</a>> wrote:</div>
<br>
<div>
<div dir="ltr" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; text-decoration: none;">
<div dir="ltr">On Wed, Jan 15, 2025 at 10:41 AM MIGUEL MOLINOS PEREZ <<a href="mailto:mmolinos@us.es" target="_blank">mmolinos@us.es</a>> wrote:</div>
<div class="gmail_quote">
<blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex;">
<div>
<div>Thank you Matt.</div>
<div><br>
</div>
<div>Yes, I am getting the "CellDM" from the DMSwarm.</div>
<br>
<div>
<blockquote type="cite">
<div>
<div dir="ltr">
<div class="gmail_quote">
<div>1. I have recently overhauled this functionality because it was not flexible enough for the plasma simulation we do. Thus main and release work differently.</div>
</div>
</div>
</div>
</blockquote>
<div><br>
</div>
<div>Nice to hear that. Should I move to main?</div>
</div>
</div>
</blockquote>
<div><br>
</div>
<div>The changes allow you to have several cell DMs. I want to bin particles in space, but also in velocity, and then in the tensor product of space and velocity. Moreover, sometimes I want to use different Swarm fields as the DM field for the solver. You can
do all that with main now. If you just need a single DM with the same DM fields, release is fine.</div>
<div> </div>
<blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex;">
<div>
<div>
<blockquote type="cite">
<div>
<div dir="ltr">
<div class="gmail_quote">
<div>2. I assume you are using release</div>
</div>
</div>
</div>
</blockquote>
<div><br>
</div>
<div>You are correct. </div>
<br>
<blockquote type="cite">
<div>
<div dir="ltr">
<div class="gmail_quote">
<div>3. In both main and release, if you change the coordinates of your CellDM mesh, you need to rebin the particles. The easiest way to do this is to call DMSwarmMigrate(sw, PETSC_FALSE).</div>
</div>
</div>
</div>
</blockquote>
<div><br>
</div>
<div>What do you mean by rebin?</div>
</div>
</div>
</blockquote>
<div><br>
</div>
<div>When you provide the cell DM, Swrm makes a "sort context" that bins the particles into DM cells. If you change the coordinates, this binning will change, so you need it to "rebin" or recreate the sort context.</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-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex;">
<div>
<div>
<div>Miguel</div>
<div><br>
</div>
<br>
<blockquote type="cite">
<div>
<div dir="ltr">
<div class="gmail_quote">
<div> Thanks,</div>
<div><br>
</div>
<div> Matt</div>
<div> </div>
<blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex;">
Best,<br>
Miguel<br>
</blockquote>
</div>
<span class="gmail_signature_prefix">--<span> </span></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="https://urldefense.us/v3/__http://www.cse.buffalo.edu/*knepley/__;fg!!G_uCfscf7eWS!ad4_CYmqVLwmuIANP7o2NXvoqCPGFSZpW_gVLp8pQweudrYWPdqW4De1CaYkE5a1sPrs7JUO_n5fznSXl1mkRA$" target="_blank">https://www.cse.buffalo.edu/~knepley/</a><br>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
</div>
<br>
</div>
</blockquote>
</div>
<div><br clear="all">
</div>
<div><br>
</div>
<span class="gmail_signature_prefix">--<span> </span></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="https://urldefense.us/v3/__http://www.cse.buffalo.edu/*knepley/__;fg!!G_uCfscf7eWS!ad4_CYmqVLwmuIANP7o2NXvoqCPGFSZpW_gVLp8pQweudrYWPdqW4De1CaYkE5a1sPrs7JUO_n5fznSXl1mkRA$" target="_blank">https://www.cse.buffalo.edu/~knepley/</a></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
</div>
<br>
</div>
</div>
</div>
</blockquote>
</div>
<br>
</div>
</div>
</blockquote>
</div>
<div><br clear="all">
</div>
<div><br>
</div>
<span class="gmail_signature_prefix">--<span class="Apple-converted-space"> </span></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="https://urldefense.us/v3/__http://www.cse.buffalo.edu/*knepley/__;fg!!G_uCfscf7eWS!ad4_CYmqVLwmuIANP7o2NXvoqCPGFSZpW_gVLp8pQweudrYWPdqW4De1CaYkE5a1sPrs7JUO_n5fznSXl1mkRA$" target="_blank">https://www.cse.buffalo.edu/~knepley/</a><br>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
</div>
<br>
</div>
</blockquote>
</div>
<div><br clear="all">
</div>
<div><br>
</div>
<span class="gmail_signature_prefix">--<span class="Apple-converted-space"> </span></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="https://urldefense.us/v3/__http://www.cse.buffalo.edu/*knepley/__;fg!!G_uCfscf7eWS!ad4_CYmqVLwmuIANP7o2NXvoqCPGFSZpW_gVLp8pQweudrYWPdqW4De1CaYkE5a1sPrs7JUO_n5fznSXl1mkRA$" target="_blank">https://www.cse.buffalo.edu/~knepley/</a></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
</div>
<br>
</body>
</html>