On Fri, Aug 23, 2013 at 9:35 AM, Olivier Bonnefon <
[email protected]> wrote:
> Hello,
>
> Thanks for your answers, I'm now able to import and distribute a mesh:
>
You might simplify this to
if (rank) {obNbCells = 0; obNbVertex = 0;}
ierr = DMPlexCreateFromCellList(comm,**dim,obNbCells,obNbVertex,3,0,**
obCells,2,obVertex,dm);**CHKERRQ(ierr);
> if (!rank){
> ierr = DMPlexCreateFromCellList(comm,**
> dim,obNbCells,obNbVertex,3,0,**obCells,2,obVertex,dm);**CHKERRQ(ierr);
> for (i=0;i<obNbBound;i++){
> ierr =DMPlexSetLabelValue(*dm, "marker",
> obBoundary[i]+obNbCells, 1);CHKERRQ(ierr);
> }
> }else {
> ierr = DMPlexCreateFromCellList(comm,**dim,0,0,3,0,obCells,2,**
> obVertex,dm);CHKERRQ(ierr);
> }
>
> ierr = DMPlexDistribute(*dm, partitioner, 0, &distributedMesh);CHKERRQ(**
> ierr);
> if (distributedMesh) {
> ierr = DMDestroy(dm);CHKERRQ(ierr);
> *dm = distributedMesh;
> }
>
> Is it possible to known the resulting partition ? ie, What is the mapping
> between the initial cell number and the local cell (used in
> DMPlexComputeResidualFEM)?
> I need this to write an efficient implementation of the FEM struct
> functions f0 and g0, space depending.
>
Yes, but I really do not think you want to do things that way. I am
assuming you want different material models or something
in different places. The way I envision that is using a DMLabel to mark up
parts of the domain. All labels are automatically
distributed with the mesh. Is that what you want?
Thanks,
Matt
> Regards,
>
> Olivier B
>
> --
> Olivier Bonnefon
> INRA PACA-Avignon, Unité BioSP
> Tel: +33 (0)4 32 72 21 58
>
>
--
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