[petsc-users] DMMeshCreateMeshFromAdjacency

Matthew Knepley knepley at gmail.com
Sun Mar 3 19:59:20 CST 2013


On Sun, Mar 3, 2013 at 7:03 PM, Dharmendar Reddy <dharmareddy84 at gmail.com>wrote:

> Sorry, I will try to present the problem in more detial.
> So i am trying to mesh a material region. The material is usually a
> crystal with atoms located as per the lattice defining the crystal. See for
> example the attached image which has silicon atoms (spheres) in the crystal
> unit cell which is a cuboid.
>
> Now if i have a cuboid region with 10 unit cells each in x, y and z
> direction. I need to mesh this region such that I have mesh nodes at atom
> locations. The can be more mesh nodes than the atom locations.
>

I believe there is a way to do this in TetGen, but I had not added that to
the interface. I will
look at it. I think you would just add these as isolated vertices to the
boundary DM you pass
into DMPlexGenerate().

   Matt


> On Sun, Mar 3, 2013 at 5:45 PM, Matthew Knepley <knepley at gmail.com> wrote:
>
>> On Sun, Mar 3, 2013 at 6:41 PM, Dharmendar Reddy <dharmareddy84 at gmail.com
>> > wrote:
>>
>>> Let say I create triangular mesh in a square: (0,0) (0,1) (1,1) (0,1)
>>> I want (0,0.25) and (0.25,0) to be among the mesh nodes. It can have
>>> other nodes.
>>>
>>
>> These explanations are too short. From the above, all I understand is
>> that you would get
>> a line between (0, 1/4) and (1/4, 0).
>>
>>    Matt
>>
>>
>>> On Sun, Mar 3, 2013 at 5:29 PM, Matthew Knepley <knepley at gmail.com>wrote:
>>>
>>>> On Sun, Mar 3, 2013 at 5:04 PM, Dharmendar Reddy <
>>>> dharmareddy84 at gmail.com> wrote:
>>>>
>>>>> Hello,
>>>>>
>>>>>         We use cratisian mesh for certain problems only. The user
>>>>> gives the mesh file as one of the inputs. I do not know a-priori what mesh
>>>>> is created.
>>>>>
>>>>> On a related note, I am solving a system of equations where i need to
>>>>> use a fine cartisian mesh for one equation (Schrodinger)  but i would
>>>>> prefer a coarse traiangular or tetrahedral element mesh for another
>>>>> eqaution(Poisson). Is there an interface to interpolate data from one mesh
>>>>> to another?
>>>>>
>>>>
>>>> There is an interface, which is just a Mat, but there is no
>>>> infrastructure for calculating it.
>>>>
>>>>
>>>>> If i create a DM with a coarse mesh, Can i give the mesh a set of
>>>>> vertices such that after re meshing the DM has the given vertices as mesh
>>>>> nodes ? I tried using the gmsh to create a mesh with give set of vertices
>>>>> inside a region but had no success.
>>>>>
>>>>
>>>> I do not understand the question.
>>>>
>>>>   Thanks,
>>>>
>>>>      Matt
>>>>
>>>>
>>>>> Thanks
>>>>> Reddy
>>>>>
>>>>> On Sun, Mar 3, 2013 at 3:44 PM, Matthew Knepley <knepley at gmail.com>wrote:
>>>>>
>>>>>> On Sun, Mar 3, 2013 at 3:48 PM, Dharmendar Reddy <
>>>>>> dharmareddy84 at gmail.com> wrote:
>>>>>>
>>>>>>> So i should use petsc-dev ? I will try that.
>>>>>>>
>>>>>>> I there any way i can have access to submesh? Consider a this
>>>>>>> scenario.
>>>>>>> I have a two dimensional mesh in a rectangle with a uniform deltaX
>>>>>>> and deltaY gridding. Is there any way i can get submesh at say x =
>>>>>>> (i-1)*deltaX where  say i = 1 to N. The dofs on the submesh will should be
>>>>>>> mapped to dofs on the original mesh. The submesh in this case will be  a 1D
>>>>>>> mesh along y-axis.
>>>>>>>
>>>>>>
>>>>>> 1) If you have a Cartesian mesh, use DMDA. This is no point in an
>>>>>> unstructured mesh.
>>>>>>
>>>>>> 2) Yes, you can extract a submesh based upon labeled vertices using
>>>>>> DMPlexCreateSubmesh(). It will have
>>>>>>     a map between points in the submesh and original mesh.
>>>>>>
>>>>>>
>>>>>>> I can create each DM with input celllist and create maps after that
>>>>>>> but i am wondering if this can be done via DMgetsubDM kind of call ?
>>>>>>>
>>>>>>
>>>>>>     Matt
>>>>>>
>>>>>>
>>>>>>> Thanks
>>>>>>> Reddy
>>>>>>>
>>>>>>> On Sun, Mar 3, 2013 at 2:11 PM, Matthew Knepley <knepley at gmail.com>wrote:
>>>>>>>
>>>>>>>> On Sun, Mar 3, 2013 at 2:37 PM, Dharmendar Reddy <
>>>>>>>> dharmareddy84 at gmail.com> wrote:
>>>>>>>>
>>>>>>>>> Hello,
>>>>>>>>>
>>>>>>>>>          Thanks. I will have the code compiled with-cxx and
>>>>>>>>> with-sieve.
>>>>>>>>> The error is understandable when i look at the following line from
>>>>>>>>> meshcreate.c
>>>>>>>>>
>>>>>>>>> 312:   if (interpolate) {SETERRQ <http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Sys/SETERRQ.html#SETERRQ>(comm, PETSC_ERR_SUP, "Interpolation (creation of faces and edges) is not yet supported.");}
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> Any idea if this feature will be implimented? I am trying to import mesh from gmsh.
>>>>>>>>> I have a Fortran code which will genrate list for faces and edges for a given mesh.
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> Is there a DMMEsh interface through which i can input list of edges and faces ?
>>>>>>>>>
>>>>>>>>>
>>>>>>>> DMMesh was an initial implementation of these ideas, but did not
>>>>>>>> interface well with
>>>>>>>> solvers, so it has been rewritten in C as DMPlex. The interface is
>>>>>>>> almost exactly the
>>>>>>>> same, and if you want increased functionality I would encourage you
>>>>>>>> to switch. For
>>>>>>>> example, DMMeshCreateMeshFromAdjacency() becomes
>>>>>>>>
>>>>>>>>   DMPlexCreateFromCellList()
>>>>>>>>
>>>>>>>> and you can follow this with
>>>>>>>>
>>>>>>>>   DMInterpolate()
>>>>>>>>
>>>>>>>> to automatically create the edges and faces.
>>>>>>>>
>>>>>>>>   Thanks,
>>>>>>>>
>>>>>>>>      Matt
>>>>>>>>
>>>>>>>>
>>>>>>>>> Thanks
>>>>>>>>> Reddy
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> On Sun, Mar 3, 2013 at 12:23 AM, Satish Balay <balay at mcs.anl.gov>wrote:
>>>>>>>>>
>>>>>>>>>> BTW: I don't get compile errors with this code using petsc-3.3
>>>>>>>>>> built with:
>>>>>>>>>>
>>>>>>>>>>  --with-clanguage=cxx --with-sieve=1 --with-boost=1
>>>>>>>>>>
>>>>>>>>>> [the code fails to run though..]
>>>>>>>>>>
>>>>>>>>>> Satish
>>>>>>>>>>
>>>>>>>>>> ---------
>>>>>>>>>>
>>>>>>>>>> asterix:/home/balay/download-pine>make
>>>>>>>>>> PETSC_DIR=/home/balay/petsc-dist-test PETSC_ARCH=asterix64-sieve
>>>>>>>>>> petscDMTest_v2
>>>>>>>>>> /home/balay/soft/linux64/mpich2-1.1/bin/mpif90 -c  -fPIC -Wall
>>>>>>>>>> -Wno-unused-variable -Wno-unused-dummy-argument -g
>>>>>>>>>> -I/home/balay/petsc-dist-test/include
>>>>>>>>>> -I/home/balay/petsc-dist-test/asterix64-sieve/include
>>>>>>>>>> -I/home/balay/petsc-dist-test/include/sieve
>>>>>>>>>> -I/home/balay/soft/linux64/mpich2-1.1/include
>>>>>>>>>> -I/home/balay/soft/mpich2-1.5/include    -o petscDMTest_v2.o
>>>>>>>>>> petscDMTest_v2.F90
>>>>>>>>>> /home/balay/soft/linux64/mpich2-1.1/bin/mpif90 -fPIC -Wall
>>>>>>>>>> -Wno-unused-variable -Wno-unused-dummy-argument -g   -o petscDMTest_v2
>>>>>>>>>> petscDMTest_v2.o
>>>>>>>>>>  -Wl,-rpath,/home/balay/petsc-dist-test/asterix64-sieve/lib
>>>>>>>>>> -L/home/balay/petsc-dist-test/asterix64-sieve/lib  -lpetsc -lX11 -lpthread
>>>>>>>>>> -llapack -lblas -lm -Wl,-rpath,/home/balay/soft/mpich2-1.5/lib
>>>>>>>>>> -L/home/balay/soft/mpich2-1.5/lib
>>>>>>>>>> -Wl,-rpath,/usr/lib/gcc/x86_64-redhat-linux/4.7.2
>>>>>>>>>> -L/usr/lib/gcc/x86_64-redhat-linux/4.7.2 -lmpichf90 -lgfortran -lm
>>>>>>>>>> -lgfortran -lm -lquadmath -lm -lmpichcxx -lstdc++ -ldl -lmpich -lopa -lmpl
>>>>>>>>>> -lrt -lgcc_s -ldl
>>>>>>>>>> /usr/bin/rm -f petscDMTest_v2.o
>>>>>>>>>> asterix:/home/balay/download-pine>./petscDMTest_v2
>>>>>>>>>> [0]PETSC ERROR: --------------------- Error Message
>>>>>>>>>> ------------------------------------
>>>>>>>>>> [0]PETSC ERROR: No support for this operation for this object
>>>>>>>>>> type!
>>>>>>>>>> [0]PETSC ERROR: Interpolation (creation of faces and edges) is
>>>>>>>>>> not yet supported.!
>>>>>>>>>> [0]PETSC ERROR:
>>>>>>>>>> ------------------------------------------------------------------------
>>>>>>>>>> [0]PETSC ERROR: Petsc Release Version 3.3.0, Patch 6, unknown
>>>>>>>>>> [0]PETSC ERROR: See docs/changes/index.html for recent updates.
>>>>>>>>>> [0]PETSC ERROR: See docs/faq.html for hints about trouble
>>>>>>>>>> shooting.
>>>>>>>>>> [0]PETSC ERROR: See docs/index.html for manual pages.
>>>>>>>>>> [0]PETSC ERROR:
>>>>>>>>>> ------------------------------------------------------------------------
>>>>>>>>>> [0]PETSC ERROR: ./petscDMTest_v2 on a asterix64 named asterix by
>>>>>>>>>> balay Sun Mar  3 00:21:29 2013
>>>>>>>>>> [0]PETSC ERROR: Libraries linked from
>>>>>>>>>> /home/balay/petsc-dist-test/asterix64-sieve/lib
>>>>>>>>>> [0]PETSC ERROR: Configure run at Sun Mar  3 00:15:25 2013
>>>>>>>>>> [0]PETSC ERROR: Configure options
>>>>>>>>>> --with-mpi-dir=/home/balay/soft/linux64/mpich2-1.1
>>>>>>>>>> --with-shared-libraries=1 --with-clanguage=cxx --with-sieve=1
>>>>>>>>>> PETSC_ARCH=asterix64-sieve --with-boost=1
>>>>>>>>>> [0]PETSC ERROR:
>>>>>>>>>> ------------------------------------------------------------------------
>>>>>>>>>> [0]PETSC ERROR: DMMeshCreateMeshFromAdjacency() line 312 in
>>>>>>>>>> /home/balay/petsc-dist-test/src/dm/impls/mesh/meshcreate.c
>>>>>>>>>>  Surcessfully Loaded mesh into DM
>>>>>>>>>> asterix:/home/balay/download-pine>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> On Sat, 2 Mar 2013, Satish Balay wrote:
>>>>>>>>>>
>>>>>>>>>> > Fortran compiler doesn't care about presence or absence of
>>>>>>>>>> interface
>>>>>>>>>> > defintions. If they exist - then it does extra prototype
>>>>>>>>>> checks. If
>>>>>>>>>> > they don't exist - it assumes f77 and chugs along].
>>>>>>>>>> >
>>>>>>>>>> > Did you build petsc with sieve [and cxx]?  send make.log for
>>>>>>>>>> this
>>>>>>>>>> > petsc build. Also what do you get for:
>>>>>>>>>> >
>>>>>>>>>> > nm -Ao libpetsc.a |grep -i DMMeshCreateMeshFromAdjacency
>>>>>>>>>> >
>>>>>>>>>> > You can followup this issue [with logs] on petsc-maint.
>>>>>>>>>> >
>>>>>>>>>> > Satish
>>>>>>>>>> >
>>>>>>>>>> >
>>>>>>>>>> > On Sat, 2 Mar 2013, Dharmendar Reddy wrote:
>>>>>>>>>> >
>>>>>>>>>> > > As you said, I do not need, PETSC_USE_FORTRAN_INTERFACES. The
>>>>>>>>>> interface to
>>>>>>>>>> > > dmmeshcreatefromadjacency is not defined in
>>>>>>>>>> > >
>>>>>>>>>> > > finclude/ftn-custom/petscdmmesh.h90
>>>>>>>>>> > >
>>>>>>>>>> > > it is only defined in
>>>>>>>>>> > >
>>>>>>>>>> > > finclude/ftn-auto/petscdmmesh.h90
>>>>>>>>>> > >
>>>>>>>>>> > >
>>>>>>>>>> > > On Sat, Mar 2, 2013 at 7:51 PM, Dharmendar Reddy <
>>>>>>>>>> dharmareddy84 at gmail.com>wrote:
>>>>>>>>>> > >
>>>>>>>>>> > > > Hello,
>>>>>>>>>> > > >         Sorry, I was going to create a test case. Anyways
>>>>>>>>>> here is the
>>>>>>>>>> > > > error message
>>>>>>>>>> > > >
>>>>>>>>>> > > > petscDMTest_v2.o: In function `MAIN__':
>>>>>>>>>> > > > petscDMTest_v2.F90:(.text+0x354): undefined reference to
>>>>>>>>>> > > > `dmmeshcreatemeshfromad
>>>>>>>>>> > > > jacency_'
>>>>>>>>>> > > > make: [testDMMesh] Error 1 (ignored)
>>>>>>>>>> > > >
>>>>>>>>>> > > > I have attached a test case and makefile.  make all should
>>>>>>>>>> gen rate the
>>>>>>>>>> > > > executable.
>>>>>>>>>> > > >
>>>>>>>>>> > > > Thanks
>>>>>>>>>> > > > Reddy
>>>>>>>>>> > > >
>>>>>>>>>> > > >
>>>>>>>>>> > > > On Sat, Mar 2, 2013 at 7:10 PM, Satish Balay <
>>>>>>>>>> balay at mcs.anl.gov> wrote:
>>>>>>>>>> > > >
>>>>>>>>>> > > >> On Sat, 2 Mar 2013, Dharmendar Reddy wrote:
>>>>>>>>>> > > >>
>>>>>>>>>> > > >> > Hello,
>>>>>>>>>> > > >> >         I am trying to use DMMeshCreateMeshFromAdjacency
>>>>>>>>>> in a Fortran
>>>>>>>>>> > > >> code.
>>>>>>>>>> > > >> > I get undefined reference error.
>>>>>>>>>> > > >>
>>>>>>>>>> > > >> What error? please copy/paste
>>>>>>>>>> > > >>
>>>>>>>>>> > > >> > I include the following file in my program
>>>>>>>>>> > > >> > #include "finclude/petsc.h90"
>>>>>>>>>> > > >> >
>>>>>>>>>> > > >> > I see that fortran interface to
>>>>>>>>>> DMMeshCreateMeshFromAdjacency is defined
>>>>>>>>>> > > >> > only in
>>>>>>>>>> > > >> >
>>>>>>>>>> > > >> > finclude/ftn-auto/petscdmmesh.h90
>>>>>>>>>> > > >> >
>>>>>>>>>> > > >> > I am not able to figure out if
>>>>>>>>>> PETSC_USE_FORTRAN_INTERFACES is defined.
>>>>>>>>>> > > >> I
>>>>>>>>>> > > >> > did not compile the code. I am runing the code on TACC
>>>>>>>>>> stampede. I tried
>>>>>>>>>> > > >> > adding
>>>>>>>>>> > > >> >
>>>>>>>>>> > > >> > #define PETSC_USE_FORTRAN_INTERFACES 1
>>>>>>>>>> > > >> > in my program before the petsc inlcude line but i still
>>>>>>>>>> get error.
>>>>>>>>>> > > >>
>>>>>>>>>> > > >> 1. again 'get error' doesn't tell us anything.
>>>>>>>>>> > > >>
>>>>>>>>>> > > >> And you shouldn't need PETSC_USE_FORTRAN_INTERFACES to use
>>>>>>>>>> > > >> DMMeshCreateMeshFromAdjacency
>>>>>>>>>> > > >>
>>>>>>>>>> > > >> Satish
>>>>>>>>>> > > >>
>>>>>>>>>> > > >> >
>>>>>>>>>> > > >> >
>>>>>>>>>> > > >> > Thanks
>>>>>>>>>> > > >> > Reddy
>>>>>>>>>> > > >> >
>>>>>>>>>> > > >> >
>>>>>>>>>> > > >>
>>>>>>>>>> > > >>
>>>>>>>>>> > > >
>>>>>>>>>> > > >
>>>>>>>>>> > > > --
>>>>>>>>>> > > > -----------------------------------------------------
>>>>>>>>>> > > > Dharmendar Reddy Palle
>>>>>>>>>> > > > Graduate Student
>>>>>>>>>> > > > Microelectronics Research center,
>>>>>>>>>> > > > University of Texas at Austin,
>>>>>>>>>> > > > 10100 Burnet Road, Bldg. 160
>>>>>>>>>> > > > MER 2.608F, TX 78758-4445
>>>>>>>>>> > > > e-mail: dharmareddy84 at gmail.com
>>>>>>>>>> > > > Phone: +1-512-350-9082
>>>>>>>>>> > > > United States of America.
>>>>>>>>>> > > > Homepage: https://webspace.utexas.edu/~dpr342
>>>>>>>>>> > > >
>>>>>>>>>> > >
>>>>>>>>>> > >
>>>>>>>>>> > >
>>>>>>>>>> > >
>>>>>>>>>> >
>>>>>>>>>> >
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> --
>>>>>>>>> -----------------------------------------------------
>>>>>>>>> Dharmendar Reddy Palle
>>>>>>>>> Graduate Student
>>>>>>>>> Microelectronics Research center,
>>>>>>>>> University of Texas at Austin,
>>>>>>>>> 10100 Burnet Road, Bldg. 160
>>>>>>>>> MER 2.608F, TX 78758-4445
>>>>>>>>> e-mail: dharmareddy84 at gmail.com
>>>>>>>>> Phone: +1-512-350-9082
>>>>>>>>> United States of America.
>>>>>>>>> Homepage: https://webspace.utexas.edu/~dpr342
>>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> --
>>>>>>>> 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
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> --
>>>>>>> -----------------------------------------------------
>>>>>>> Dharmendar Reddy Palle
>>>>>>> Graduate Student
>>>>>>> Microelectronics Research center,
>>>>>>> University of Texas at Austin,
>>>>>>> 10100 Burnet Road, Bldg. 160
>>>>>>> MER 2.608F, TX 78758-4445
>>>>>>> e-mail: dharmareddy84 at gmail.com
>>>>>>> Phone: +1-512-350-9082
>>>>>>> United States of America.
>>>>>>> Homepage: https://webspace.utexas.edu/~dpr342
>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> 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
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> -----------------------------------------------------
>>>>> Dharmendar Reddy Palle
>>>>> Graduate Student
>>>>> Microelectronics Research center,
>>>>> University of Texas at Austin,
>>>>> 10100 Burnet Road, Bldg. 160
>>>>> MER 2.608F, TX 78758-4445
>>>>> e-mail: dharmareddy84 at gmail.com
>>>>> Phone: +1-512-350-9082
>>>>> United States of America.
>>>>> Homepage: https://webspace.utexas.edu/~dpr342
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> 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
>>>>
>>>
>>>
>>>
>>> --
>>> -----------------------------------------------------
>>> Dharmendar Reddy Palle
>>> Graduate Student
>>> Microelectronics Research center,
>>> University of Texas at Austin,
>>> 10100 Burnet Road, Bldg. 160
>>> MER 2.608F, TX 78758-4445
>>> e-mail: dharmareddy84 at gmail.com
>>> Phone: +1-512-350-9082
>>> United States of America.
>>> Homepage: https://webspace.utexas.edu/~dpr342
>>>
>>
>>
>>
>> --
>> 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
>>
>
>
>
> --
> -----------------------------------------------------
> Dharmendar Reddy Palle
> Graduate Student
> Microelectronics Research center,
> University of Texas at Austin,
> 10100 Burnet Road, Bldg. 160
> MER 2.608F, TX 78758-4445
> e-mail: dharmareddy84 at gmail.com
> Phone: +1-512-350-9082
> United States of America.
> Homepage: https://webspace.utexas.edu/~dpr342
>



-- 
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/20130303/1179d95b/attachment-0001.html>


More information about the petsc-users mailing list