[petsc-users] PetscDSSetResidual/PetscDSSetJacobian in fortran

Matthew Knepley knepley at gmail.com
Mon May 23 19:59:05 CDT 2016


On Mon, May 23, 2016 at 12:23 PM, Nestor Cerpa Gilvonio <ncerpagi at umn.edu>
wrote:

> Thank you for the response.
> However, I am unsure what you mean by “to handle discretization
> themselves”. Would you recommend (or is it possible) to still use
> PetscFE/PetscQuadrature functions and then use this data to evaluate
> residual and jacobian using SNESSet…(), or is it better to just use our own
> pieces of code for all of this ?
>

I mean they use DMPlex to handle topolgoy/geometry and PetscSection to
handle parallel data layout. However,
they do not use PetscFE/FV or PetscDS, instead managing the discretization
and assembly themselves.

You could easily use PetscFE/Quad and your own assembly loop (its fairly
easy to look at mine). I would recommend
the local version SNESSetFunctionLocal().

  Thanks,

     Matt


> Thanks,
>
> Nestor
>
>
> ---------------------------------------------------
> ---------------------------------------------------
>
> Nestor Cerpa Gilvonio
> Postdoctoral researcher
>
> Department of Earth Sciences
> University of Minnesota
> 310 Pillsbury Drive SE
> Minnepolis, MN 55455
>
> E-mail : ncerpagi at umn.edu
>
>
>
> On May 22, 2016, at 7:06 AM, Matthew Knepley <knepley at gmail.com> wrote:
>
> On Sun, May 22, 2016 at 2:08 AM, Nestor Cerpa <ncerpagi at umn.edu> wrote:
>
>> Hello,
>>
>> I am trying to use PetscDSSetResidual and PetscDSSetJacobian in a simple
>> fortran code but they seem to be missing in the include files
>> (petsc-master). I get this error message :
>>
>
> They are not there. Taking function pointers from Fortran is complex, and
> I do not understand the new
> framework that Jed put in place to do this. It is used, for example in
> SNESSetFunction(). I would be
> happy to integrate code if you have time to implement it, but right now I
> am pressed for time.
>
>
>> *Undefined symbols for architecture x86_64:*
>> *  "_petscdssetresidual_", referenced from:*
>> *      _MAIN__ in Poisson.o*
>> *ld: symbol(s) not found for architecture x86_64*
>> *collect2: error: ld returned 1 exit status*
>> *make: [Poisson] Error 1 (ignored)*
>> */bin/rm -f -f Poisson.o*
>>
>> I am also wondering if there are snes examples like ex12 or ex62 in
>> fortran?
>>
>
> Everyone using Plex in Fortran has so far preferred to handle the
> discretization themselves. I hope
> that changes, but as you note I will have to get the pointwise function
> support in there first.
>
>   Thanks,
>
>      Matt
>
>
>> Thanks,
>> Nestor
>>
>> ---------------------------------------------------
>> ---------------------------------------------------
>>
>> Nestor Cerpa Gilvonio
>> Postdoctoral research associate
>>
>> Department of Earth Sciences
>> University of Minnesota
>> 310 Pillsbury Drive SE
>> Minnepolis, MN 55455
>>
>> E-mail : ncerpagi at umn.edu <cerpa003 at umn.edu>
>>
>>
>>
>
>
> --
> 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
>
>
>


-- 
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/20160523/d45f5ea8/attachment.html>


More information about the petsc-users mailing list