[petsc-users] Using PETSc to read/manipulate mesh files
Matthew Knepley
knepley at gmail.com
Wed Apr 26 08:37:15 CDT 2017
On Wed, Apr 26, 2017 at 2:42 AM, Aroli Marcellinus <
aroli.marcellinus at gmail.com> wrote:
> Dear all,
>
> I have this kind of mesh file, and I want to use PETSc to include the
> information of this file.
>
>
> In short, this file contains of:
>
> <NUM_OF_NODES> <NUM_OF_ELEMENTS> <1> <2> <3>
> <NODE1_X_COORD> <NODE1_Y_COORD> <NODE1_Z_COORD> <FLAG>
> <NODE2_X_COORD> <NODE2_Y_COORD> <NODE2_Z_COORD> <FLAG>
> <NODE3_X_COORD> <NODE3_Y_COORD> <NODE3_Z_COORD> <FLAG>
> ...
> ...
> ...
> <NODEN_X_COORD> <NODEN_Y_COORD> <NODEN_Z_COORD> <FLAG>
> <ELEMENT_NUMBER_1> <ELEMENT_NUMBER_2> <ELEMENT_NUMBER_3>
> <ELEMENT_NUMBER_4> <----showing element connectivity from node 1 2 3 and 4.
>
> Can I read this kind of data into PETSc? I am new in PETSc and want to use
> it for this purpose.
>
>
> Actually, this file contains a mesh of cardiac heart, and I want to
> convert this data into a suitable mesh data structure, and I thought that
> PETSc have a kind of mesh data structure. However, after surfing into a lot
> of tutorial, I cannot find any references that suits my purpose.
>
You could write a PETSc program to read in the data, and call
http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/DM/DMPlexCreateFromCellList.html
However, I would probably write a small Python program to convert this to
Gmsh format or MED format,
which PETSc can read natively, and so can many other programs.
Thanks,
Matt
>
>
>
> heart_het.dat
> <https://drive.google.com/file/d/0B7k-y9MbsuJUNU9PNWVmYU51alk/view?usp=drive_web>
>
> Aroli Marcellinus
>
> *Kumoh Institute of Technology**Computational Medicine Laboratory*
> 61 Daehak-ro (Sinpyeong-dong), Gumi, Gyeongbuk
> +82 10 9724 3957 <+82%2010-9724-3957>
> KTalk ID: vondarkness
>
--
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/20170426/dfa87fff/attachment.html>
More information about the petsc-users
mailing list