<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Thu, Nov 14, 2013 at 8:14 PM, Geoffrey Irving <span dir="ltr"><<a href="mailto:irving@naml.us" target="_blank">irving@naml.us</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On Thu, Nov 14, 2013 at 6:03 PM, Matthew Knepley <<a href="mailto:knepley@gmail.com">knepley@gmail.com</a>> wrote:<br>
> On Thu, Nov 14, 2013 at 7:43 PM, Geoffrey Irving <<a href="mailto:irving@naml.us">irving@naml.us</a>> wrote:<br>
>><br>
>> It doesn't look like there's currently a way to pass user data down to<br>
>> the various fields in PetscFEM. Can I add an extra argument to each<br>
>> function, or is that part of the API going to change in a way that<br>
>> would obviate the extra argument?<br>
><br>
><br>
> That is by design. Here is the rationale. I want to be able to use CUDA or OpenCL<br>
> to evaluate these low-level FEM integration routines, so you can't pass in arbitrary context.<br>
><br>
> I really don't think we should need arbitrary information at the lowest level integration.<br>
> Right now you can pass in information using auxiliary fields. How would you use<br>
> other stuff?<br>
<br>
</div>Well, you're probably not going to like application 1, which is<br>
passing around PyObject*'s so I can write little FEM explorations in<br>
numpy. Is the field support the right thing to do for constant<br>
fields, or integer valued constant fields?</blockquote><div><br></div><div>I should explain further. Here is the hierarchy:</div><div><br></div><div> SNESComputeFunction (global)</div><div> --> SNESComputeFunction_DMLocal (l2g)</div>
<div> --> DMPlexComputeResidualFEM (local)</div><div> --> PetscFEIntegrateResidual (chunk of cells)</div><div> --> kernel (batch of cells)</div><div><br></div><div>I can be talked into a context all the way down to the kernel, which only integrates a few cells</div>
<div>(like 32), but I would think that what you would do is write another PetscFE that calls Python</div><div>(I have one for the CPU and one for OpenCL), and it has a context.</div><div><br></div><div> Matt</div><div> </div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="HOEnZb"><font color="#888888"><br>
Geoffrey<br>
</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br>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>