[petsc-users] Is there anything like a "DMPlexSetCones()" ?

Matthew Knepley knepley at gmail.com
Wed May 1 19:07:07 CDT 2024


On Wed, May 1, 2024 at 3:34 PM Ferrand, Jesus A. <FERRANJ2 at my.erau.edu>
wrote:

> Dear PETSc team: For a project that I'm working on, I need to manually
> build a DMPlex. From studying the source code of the various APIs in which
> the plex is built from some supported file format, I get that the workflow
> is this: DMPlexSetChart()
> ZjQcmQRYFpfptBannerStart
> This Message Is From an External Sender
> This message came from outside your organization.
>
> ZjQcmQRYFpfptBannerEnd
> Dear PETSc team:
>
> For a project that I'm working on, I need to manually build a DMPlex.
> From studying the source code of the various APIs in which the plex is
> built from some supported file format, I get that the workflow is this:
>
>
>    1. DMPlexSetChart() <-- Input nCells + nVerts
>    2. DMPlexSetConeSize() <-- Input ConeSize for each point in [0,nCells)
>    3. DMSetUp() – Allocates memory internally.
>    4. DMPlexGetCones() --> Gives you the memory onto which to write the
>    cell connectivity.
>    5. *Write connectivity*
>    6. DMPlexReorderCell() <-- For each point in [0,nCells)
>
>
> I'm in a situation where the memory given by step (4) is available
> a-priori.
> I was hoping to skip steps 2, 3 , and 4 with something like a
> "DMPlexSetCones()", but such an API does not exist.
> My current workaround is to implement steps 2 through 4 as always and have
> double the memory allocated in the interim (my instance + DM's internal
> instance).
> I was thinking of looking for the name of the struct member and = it to my
> memory, but I can't overcome the flag check in DMSetUp() during later calls
> to DMPlexGetCones() or DMPlexGetTransitiveClosure().
>

I do not understand the "flag check". What is that?

We could make a DMPlexSetCones(), but as you point out, the workflow for
DMSetUp() would have to change. Where does the memory come from for your
connectivity?

  Thanks,

    Matt


>
> Sincerely:
>
> *J.A. Ferrand*
>
> Embry-Riddle Aeronautical University - Daytona Beach - FL
> Ph.D. Candidate, Aerospace Engineering
>
> M.Sc. Aerospace Engineering
>
> B.Sc. Aerospace Engineering
>
> B.Sc. Computational Mathematics
>
>
> *Phone:* (386)-843-1829
>
> *Email(s):* ferranj2 at my.erau.edu
>
>     jesus.ferrand at gmail.com
>


-- 
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

https://urldefense.us/v3/__https://www.cse.buffalo.edu/*knepley/__;fg!!G_uCfscf7eWS!ZR1_fNBzyO9hgjbXCkFEbX3CMsLXVmoeah8FCeMOb9AMhbszC-gLvEU6mbq67TLMx9kDRY2b--nt1pUHr_Np$  <https://urldefense.us/v3/__http://www.cse.buffalo.edu/*knepley/__;fg!!G_uCfscf7eWS!ZR1_fNBzyO9hgjbXCkFEbX3CMsLXVmoeah8FCeMOb9AMhbszC-gLvEU6mbq67TLMx9kDRY2b--nt1nRnavyF$ >
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20240501/9cd9b7f4/attachment-0001.html>


More information about the petsc-users mailing list