[petsc-users] FEM 101

Matthew Knepley knepley at gmail.com
Tue Mar 31 15:20:13 CDT 2015


On Tue, Mar 31, 2015 at 2:33 PM, Justin Pogacnik <j.pogacnik at auckland.ac.nz>
wrote:

>  Yep, thanks for that Matt. I'll start playing around with the
> PetscFEIntegrate routines in C++. Is there any plan to make those
> accessible in F90?
>

I will write any wrappers you need for F90. However, I wait until people
ask because its a pain with arrays. There are legit
reasons for writing in F90, but I would think deeply one more time before
committing to a new project in that language.


> Also, I'm not seeing DMPlexIntegrateResidual.
>

I typed it wrong. Its DMPlexComputeResidualFEM():


https://bitbucket.org/petsc/petsc/src/569f457242c46be7b11883bb57411ddc0c41c340/src/snes/utils/dmplexsnes.c?at=master#cl-1939

   Thanks,

     Matt


> Thanks for the help,
>
>  Justin
>  ------------------------------
> *From:* Matthew Knepley [knepley at gmail.com]
> *Sent:* Tuesday, March 31, 2015 5:14 PM
> *To:* Justin Pogacnik
> *Cc:* petsc-users at mcs.anl.gov
> *Subject:* Re: [petsc-users] FEM 101
>
>    On Mon, Mar 30, 2015 at 4:39 PM, Justin Pogacnik <
> j.pogacnik at auckland.ac.nz> wrote:
>
>>  Hello,
>>
>>  I'm beginning to write a finite element solid mechanics code in F90 and
>> am having some problems getting started with finite element basics within
>> Petsc. I'm using an unstructured grid and the DMPlex class and able to
>> access most of the mesh information required for FE numerical integration.
>> I've used PetscFECreateDefault and have found the quadrature point
>> locations/data. I'm trying to determine how to find the values of standard
>> trilinear basis functions and their derivatives at the element quadrature
>> points and then to perform the integration on the element. Can anyone
>> advise what the proper routines are that I should call? It's possible that
>> I'm way off target. I've seen "PetscFEGetBasisSpace", but I'm unsure what
>> to do with the resulting output space. I've also seen the PetscFEIntegrate
>> routines, but unsure how their intended to be used and don't see any
>> fortran wrappers.
>>
>>  I hope this question is clear. Please let me know if you require more
>> information. I appreciate any help and guidance that anyone can offer.
>>
>
>  Here is the plain vanilla integration routine:
>
>
> https://bitbucket.org/petsc/petsc/src/1c9d18e7633f5b782021dca6d8727de2838ee261/src/dm/dt/interface/dtfe.c?at=master#cl-3380
>
>  which is an implementation of PetscFEIntegrate(). The idea is that this
> integrates a bunch of elements, and then there is an outer
> loop over the whole mesh, which is currently DMPlexIntegrateResidual().
> Unfortunately, this function also does a bunch of other
> stuff, and right now I do not see how to simplify it.
>
>  Does this make sense?
>
>    Thanks,
>
>       Matt
>
>
>>  Many thanks,
>>
>>  Justin
>>
>
>
>
>  --
> 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/20150331/e71bd0ad/attachment-0001.html>


More information about the petsc-users mailing list