[petsc-dev] Need mechanism to set LocalToGlobal mapping in a DMShell
Dmitry Karpeev
karpeev at mcs.anl.gov
Thu Feb 21 12:58:10 CST 2013
On Thu, Feb 21, 2013 at 12:54 PM, Richard Tran Mills <rtm at eecs.utk.edu>wrote:
> Hi Jed,
>
> The reason is that in the PFLOTRAN code we currently have some code like
> this:
>
> select case(discretization%itype)
> case(STRUCTURED_GRID,STRUCTURED_GRID_MIMETIC)
> call
> DMLocalToGlobalBegin(dm_ptr%sgdm,local_vec,INSERT_VALUES,global_vec,ierr)
> call
> DMLocalToGlobalEnd(dm_ptr%sgdm,local_vec,INSERT_VALUES,global_vec,ierr)
> case(UNSTRUCTURED_GRID)
> call VecScatterBegin(dm_ptr%ugdm%scatter_ltog,local_vec,global_vec, &
> INSERT_VALUES,SCATTER_FORWARD,ierr)
> call VecScatterEnd(dm_ptr%ugdm%scatter_ltog,local_vec,global_vec, &
> INSERT_VALUES,SCATTER_FORWARD,ierr)
> end select
>
> where in the STRUCTURED_GRID case we have a DMDA. In the
> UNSTRUCTURED_GRID case we have no DM, and I want to pack things into a
> DMShell so that have a DM and the various DM calls work (and then I can
> eliminate these 'select case' statements).
>
> (Eventually I'd like to be using more of the PETSc infrastructure and not
> even calling DMLocalToGlobalBegin(), etc., in the PFLOTRAN code, but that
> can wait a bit.)
>
I would vote for DMGetLocalToGlobalMapping() etc.
That has the flexibility to be used with DM-impl-oblivious codes.
Dmitry.
>
>
> --Richard
>
>
>
> On 2/21/13 1:42 PM, Jed Brown wrote:
>
> It would be natural to have a matching interface, but why do you need it?
> You're in charge of making the matrices and vectors so you can give them
> local-to-global mappings. The only solver that calls
> DMGetLocalToGlobalMapping is PCEXOTIC, which only works with DMDA anyway.
>
>
> On Thu, Feb 21, 2013 at 12:35 PM, Richard Tran Mills <rtm at eecs.utk.edu>wrote:
>
>> Hi Folks,
>>
>> I want to set a LocalToGlobal mapping in a DMShell object. Should we add
>> a DMShell routine to do this, or just add a DMSetLocalToGlobalMapping()
>> routine?
>>
>> Thanks,
>> Richard
>>
>> --
>> Richard Tran Mills, Ph.D.
>> Computational Earth Scientist | Joint Assistant Professor
>> Hydrogeochemical Dynamics Team | EECS and Earth & Planetary Sciences
>> Oak Ridge National Laboratory | University of Tennessee, Knoxville
>> E-mail: rmills at ornl.gov V: 865-241-3198 http://climate.ornl.gov/~rmills
>>
>>
>
>
> --
> Richard Tran Mills, Ph.D.
> Computational Earth Scientist | Joint Assistant Professor
> Hydrogeochemical Dynamics Team | EECS and Earth & Planetary Sciences
> Oak Ridge National Laboratory | University of Tennessee, Knoxville
> E-mail: rmills at ornl.gov V: 865-241-3198 http://climate.ornl.gov/~rmills
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20130221/e2c56679/attachment.html>
More information about the petsc-dev
mailing list