[petsc-users] petscfe_type opencl, variable_coefficient field

Matthew Knepley knepley at gmail.com
Tue Apr 22 10:16:27 CDT 2014


On Tue, Apr 22, 2014 at 9:42 AM, Karl Rupp <rupp at iue.tuwien.ac.at> wrote:

> Hi David,
>
> > Thanks. Also, the physics seems to be controlled by the "op" variable?
>
>> Is there an interface to change the physics from the user code ?
>>
>
> I know that our intention is to provide the user with control over the
> physics in the long run, but (unless Matt implemented something recently)
> this is still work in progress...
>

This was just my quick hack. Its not bad for a user to change. You just
provide the source for the
pointwise function that you would have on the CPU. I did not put in the
interface for passing in a
string instead of a function pointer because I was the only one using it.
If you use it too, I will put
it in.

  Thanks,

     Matt


> Best regards,
> Karli
>
>
>
>
>> https://bitbucket.org/petsc/petsc/src/fb3a4ffdea0449562fb0f58dad4b44
>> 552b6d3589/src/dm/dt/interface/dtfe.c?at=master#cl-5028
>>
>> switch (op) {
>>    case LAPLACIAN:
>>      if (useF0) {ierr = PetscSNPrintfCount(string_tail, end_of_buffer -
>> string_tail, "      f_0[fidx] = 4.0;\n", &count);STRING_ERROR_CHECK("Message
>> to short");}
>>      if (useF1) {
>>        if (useAux) {ierr = PetscSNPrintfCount(string_tail, end_of_buffer
>> - string_tail, "      f_1[fidx] = a[cell]*gradU[cidx];\n",
>> &count);STRING_ERROR_CHECK("Message to short");}
>>        else        {ierr = PetscSNPrintfCount(string_tail, end_of_buffer
>> - string_tail, "      f_1[fidx] = gradU[cidx];\n",
>> &count);STRING_ERROR_CHECK("Message to short");}
>>      }
>>      break;
>>    case ELASTICITY:
>>      if (useF0) {i
>>
>>
>>
>>
>> On Tue, Apr 22, 2014 at 5:03 AM, Karl Rupp <rupp at iue.tuwien.ac.at
>> <mailto:rupp at iue.tuwien.ac.at>> wrote:
>>
>>     Hi David,
>>
>>
>>      > I'm trying to use
>>
>>
>>         -variable_coefficient field  with -petscfe_type opencl
>>         -mat_petscfe_type
>>            opencl
>>
>>         constant coefficients "-variable_coefficient none" works fine,
>>         but I am
>>         getting NaN in my residual vector for spatially varying
>>         coefficients.
>>
>>         I tried changing N_t manually for N_comp_aux =1, also tried
>>         setting my
>>         variable coefficient field to a constant at each quadrature
>>         point to see
>>         if any difference.
>>
>>
>>     This is - unfortunately - a known issue, where we currently don't
>>     know whether this is a race condition in the OpenCL kernel, or
>>     something goes wrong with the data setup. I expect this to require
>>     rather more elaborate debugging, so unfortunately I can only advise
>>     you to wait until this is fixed...
>>
>>     Best regards,
>>     Karli
>>
>>
>>
>


-- 
What most experimenters take for granted before they begin their
experiments is infinitely more interesting than any results to which their
experiments lead.
-- Norbert Wiener
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20140422/5814ee7c/attachment-0001.html>


More information about the petsc-users mailing list