[petsc-users] Identifying mesh points within DMPlex FEM

Matthew Knepley knepley at gmail.com
Tue Aug 26 05:09:00 CDT 2014


On Tue, Aug 26, 2014 at 2:11 AM, Justin Chang <jychang48 at gmail.com> wrote:

> Matt,
>
> I see how parameters (e.g., nu) change across the domain, but from what I
> understand they are all functions of the point coordinate x[ ]. This would
> be no problem if my parameters were analytical functions as shown in your
> examples or if the domain has several nicely layered regions which can be
> easily distinguished (i.e., I could simply use conditionals to determine a
> mesh point's region based on the coordinates).
>

No, they need not be functions. They are only a collection of basis
function coefficients, like any FEM field.


> However, what if I wanted nu (or any parameter for that matter) to be
> supplied through a user created data file? In PFLOTRAN, that's how physical
> data and parameters are associated with a given cell or mesh point. Here's
> the way I imagine my PETSc code would look using DMPlex:
>
> 1) Create DMPlex mesh from an input mesh file
> 2) Read data file that links physical parameters (e.g., diffusivity,
> source, etc) to DMPlex mesh points. This should create some sort of data
> structure or Vec that maps these parameters to the corresponding DMPlex
> mesh points.
> 3) Set up FEM discretization and boundary conditions. Like the physical
> parameters, boundary conditions are also generated/specified through the
> data file.
> 4) Solve problem
> 5) Post-process solution to mesh file.
>
> In step 4, the pointwise functions f0_u, f1_u, g3_uu, etc are called upon
> for each element/mesh point iteration. I suppose my question is, is there
> any way to incorporate the data formulated from step 2 into said pointwise
> functions?
>

You project the input data into the finite element space. Then this field
can be used just as in ex12.

   Thanks,

      Matt


>
> Thanks,
> Justin
>
> On Mon, Aug 25, 2014 at 4:33 PM, Matthew Knepley <knepley at gmail.com>
> wrote:
>
>> On Mon, Aug 25, 2014 at 2:10 PM, Justin Chang <jychang48 at gmail.com>
>> wrote:
>>
>>> Hi all,
>>>
>>> In the discretization schemes for the DMPlex FEM examples (ex12 and
>>> ex62), it lets us specify equations as pointwise functions. But what if I
>>> wanted to assign "regions" to different points within the domain? In one of
>>> my problems, I want the diffusivity tensor and/or forcing function to
>>> differ for various layers/regions within the computational domain. I would
>>> imagine calling something like DMPlexGetLabelValue() to identify a region
>>> associated with a given mesh point but is it possible to do something like
>>> this within the f0/f1/g3/etc functions?
>>>
>>
>> 1) Changing parameters across the domain is straightforward. ex12 does
>> this for "diffusivity".
>>
>> 2) Changing the function across the domain should probably be
>> accomplished by changing
>>      a marker parameter, which is checked inside the function itself.
>>
>>    Matt
>>
>>
>>> 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/20140826/4f088f36/attachment.html>


More information about the petsc-users mailing list