Re: [petsc-users] DMPlex H27 elements

2019-01-10 Thread Yann Jobic via petsc-users


On 08/01/2019 19:45, Yann Jobic via petsc-users wrote:



On 05/01/2019 13:23, Matthew Knepley wrote:
On Sat, Jan 5, 2019 at 4:04 AM Yann Jobic > wrote:



On 05/01/2019 02:36, Matthew Knepley wrote:

On Fri, Jan 4, 2019 at 10:04 AM Yann Jobic via petsc-users
mailto:petsc-users@mcs.anl.gov>> wrote:

Dear Petsc Users,

I'm using DMPlexCreateFromCellList to create my DM. I would
like to have
an order 2 geometry.

It's working fine in 2D for elements of type Q9.


I do not see how that is possible. The topology does not work
that way, and there
is no way a 9 vertex quad was interpolated, so something else is
happening.

Moreover, anything you input still has affine geometry. Toby has
been working on
non-affine geometry, and all the code is there, but right now
you have to build and
populate the coordinate space by hand. What this means is that
you create a
quadratic space for the coordinate DM (rather than the default
linear), get the
global coordinate vector out, and stick in the Q9 coordinates.
The topology is still
the same no matter what coordinates you read in.


I get the idea. So at the beginning i start with the Q4/H8
dmplex, then i fill from the global coordinate vector the missing
coordinates, and attach this new coordinate vector to the DM.

Yes.


So far, i can change the PetscSpace order, add this space to a 
PetscFE, and finally attach this PetscFE to a PetscDS (discetization) 
to my DM.


But if i'm doing that, the middle nodes will already be added (i 
couldn't find this function so far, could you point me the name ?). I 
can still move those middle vertex to my geometry.


But i couldn't find a way to define the quadratic space for the 
coordinate DM before all of that, at the DM (or DMPlex) level.


What way can you advise me to use in order to do that ?

I think i got it, if i'm not wrong. I mean, the first step. It was in 
the documentation...


I defined the PetscSection according to the element i use. The size of 
the matrix coming from the DM is correct.


I'm working on the next step : "populate the space coordinates".

Yann


Thank you,

Yann


Then the interpolation will be correct ?

This is the tricky part. What you likely have to do is:

  1) Build the topology
  2) Run over the cells
  3) For each cell, put in the coordinates using 
DMPlexVecSetClosure(). This is redundant, but the only way

      you can connect with the Q9 format.

Can i use DMproject and all the petsc functions ?

This is the idea. The amount of testing is so far almost nothing.

In order to output the results, i've got to write my own vtk
interface no ? (by splitting the Q9/H27 in 4xQ4 or 8xH8).

That is a good question. Right now, it will just output Q4. However, 
compared to everything else, writing Q9 should

be comparatively easy.

Or is it working with the hdf5 one ?

I would probably write code to to Xdmf through HDF5 rather than 
straight VTK, but we will end up having both.


Does the p4est interface work with this setup ?

It will. I do not know if it currently does. We have to check.

  Thanks,

    Matt



We will get around to making an interface for this soon.


Great !

Thanks,

Yann



  Thanks,

     Matt

I checked that it's working correctly by using
DMPlexComputeCellGeometryFEM, and compute the value of the
determinant
(CheckMeshGeometry of dm/impls/plex/examples/tutorials/ex2.c)

I can import H8 elements, it's working fine.

But for H27 element, it's not working. I really don't know
how to order
my vertex in the cells array. So far, the determinant is zero...

I don't know where to look in order to find this
information. I tried
the function DMPlexGetRawFaces_Internal of the file


https://www.mcs.anl.gov/petsc/petsc-current/src/dm/impls/plex/plexinterpolate.c.html#DMPlexGetRawFaces_Internal

but it didn't help me.

Could you please point me where to look ?

Thanks, and happy new year !

Yann



-- 
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

https://www.cse.buffalo.edu/~knepley/





--
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

https://www.cse.buffalo.edu/~knepley/ 



Re: [petsc-users] DMPlex H27 elements

2019-01-08 Thread Yann Jobic via petsc-users


On 05/01/2019 13:23, Matthew Knepley wrote:
On Sat, Jan 5, 2019 at 4:04 AM Yann Jobic > wrote:



On 05/01/2019 02:36, Matthew Knepley wrote:

On Fri, Jan 4, 2019 at 10:04 AM Yann Jobic via petsc-users
mailto:petsc-users@mcs.anl.gov>> wrote:

Dear Petsc Users,

I'm using DMPlexCreateFromCellList to create my DM. I would
like to have
an order 2 geometry.

It's working fine in 2D for elements of type Q9.


I do not see how that is possible. The topology does not work
that way, and there
is no way a 9 vertex quad was interpolated, so something else is
happening.

Moreover, anything you input still has affine geometry. Toby has
been working on
non-affine geometry, and all the code is there, but right now you
have to build and
populate the coordinate space by hand. What this means is that
you create a
quadratic space for the coordinate DM (rather than the default
linear), get the
global coordinate vector out, and stick in the Q9 coordinates.
The topology is still
the same no matter what coordinates you read in.


I get the idea. So at the beginning i start with the Q4/H8 dmplex,
then i fill from the global coordinate vector the missing
coordinates, and attach this new coordinate vector to the DM.

Yes.


So far, i can change the PetscSpace order, add this space to a PetscFE, 
and finally attach this PetscFE to a PetscDS (discetization) to my DM.


But if i'm doing that, the middle nodes will already be added (i 
couldn't find this function so far, could you point me the name ?). I 
can still move those middle vertex to my geometry.


But i couldn't find a way to define the quadratic space for the 
coordinate DM before all of that, at the DM (or DMPlex) level.


What way can you advise me to use in order to do that ?

Thank you,

Yann


Then the interpolation will be correct ?

This is the tricky part. What you likely have to do is:

  1) Build the topology
  2) Run over the cells
  3) For each cell, put in the coordinates using 
DMPlexVecSetClosure(). This is redundant, but the only way

      you can connect with the Q9 format.

Can i use DMproject and all the petsc functions ?

This is the idea. The amount of testing is so far almost nothing.

In order to output the results, i've got to write my own vtk
interface no ? (by splitting the Q9/H27 in 4xQ4 or 8xH8).

That is a good question. Right now, it will just output Q4. However, 
compared to everything else, writing Q9 should

be comparatively easy.

Or is it working with the hdf5 one ?

I would probably write code to to Xdmf through HDF5 rather than 
straight VTK, but we will end up having both.


Does the p4est interface work with this setup ?

It will. I do not know if it currently does. We have to check.

  Thanks,

    Matt



We will get around to making an interface for this soon.


Great !

Thanks,

Yann



  Thanks,

     Matt

I checked that it's working correctly by using
DMPlexComputeCellGeometryFEM, and compute the value of the
determinant
(CheckMeshGeometry of dm/impls/plex/examples/tutorials/ex2.c)

I can import H8 elements, it's working fine.

But for H27 element, it's not working. I really don't know
how to order
my vertex in the cells array. So far, the determinant is zero...

I don't know where to look in order to find this information.
I tried
the function DMPlexGetRawFaces_Internal of the file


https://www.mcs.anl.gov/petsc/petsc-current/src/dm/impls/plex/plexinterpolate.c.html#DMPlexGetRawFaces_Internal

but it didn't help me.

Could you please point me where to look ?

Thanks, and happy new year !

Yann



-- 
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

https://www.cse.buffalo.edu/~knepley/





--
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

https://www.cse.buffalo.edu/~knepley/ 



Re: [petsc-users] DMPlex H27 elements

2019-01-07 Thread Yann Jobic via petsc-users


Le 05/01/2019 à 13:23, Matthew Knepley a écrit :
On Sat, Jan 5, 2019 at 4:04 AM Yann Jobic > wrote:



On 05/01/2019 02:36, Matthew Knepley wrote:

On Fri, Jan 4, 2019 at 10:04 AM Yann Jobic via petsc-users
mailto:petsc-users@mcs.anl.gov>> wrote:

Dear Petsc Users,

I'm using DMPlexCreateFromCellList to create my DM. I would
like to have
an order 2 geometry.

It's working fine in 2D for elements of type Q9.


I do not see how that is possible. The topology does not work
that way, and there
is no way a 9 vertex quad was interpolated, so something else is
happening.

Moreover, anything you input still has affine geometry. Toby has
been working on
non-affine geometry, and all the code is there, but right now you
have to build and
populate the coordinate space by hand. What this means is that
you create a
quadratic space for the coordinate DM (rather than the default
linear), get the
global coordinate vector out, and stick in the Q9 coordinates.
The topology is still
the same no matter what coordinates you read in.


I get the idea. So at the beginning i start with the Q4/H8 dmplex,
then i fill from the global coordinate vector the missing
coordinates, and attach this new coordinate vector to the DM.

Yes.
In order to set up a quadratic space for my DM, i should use 
PetscDualSpaceSetOrder no ?


And then attach this space to my DM ?

When i add the missing vertex coordinates, the order should not matter 
no ? (it should at the next step with the DMPlexVecSetClosure)


I'll try to build a laplacian test case, with analytical solution in FEM 
in order to test it.


Thanks,

Yann


Then the interpolation will be correct ?

This is the tricky part. What you likely have to do is:

  1) Build the topology
  2) Run over the cells
  3) For each cell, put in the coordinates using 
DMPlexVecSetClosure(). This is redundant, but the only way

      you can connect with the Q9 format.

Can i use DMproject and all the petsc functions ?

This is the idea. The amount of testing is so far almost nothing.

In order to output the results, i've got to write my own vtk
interface no ? (by splitting the Q9/H27 in 4xQ4 or 8xH8).

That is a good question. Right now, it will just output Q4. However, 
compared to everything else, writing Q9 should

be comparatively easy.

Or is it working with the hdf5 one ?

I would probably write code to to Xdmf through HDF5 rather than 
straight VTK, but we will end up having both.


Does the p4est interface work with this setup ?

It will. I do not know if it currently does. We have to check.

  Thanks,

    Matt



We will get around to making an interface for this soon.


Great !

Thanks,

Yann



  Thanks,

     Matt

I checked that it's working correctly by using
DMPlexComputeCellGeometryFEM, and compute the value of the
determinant
(CheckMeshGeometry of dm/impls/plex/examples/tutorials/ex2.c)

I can import H8 elements, it's working fine.

But for H27 element, it's not working. I really don't know
how to order
my vertex in the cells array. So far, the determinant is zero...

I don't know where to look in order to find this information.
I tried
the function DMPlexGetRawFaces_Internal of the file


https://www.mcs.anl.gov/petsc/petsc-current/src/dm/impls/plex/plexinterpolate.c.html#DMPlexGetRawFaces_Internal

but it didn't help me.

Could you please point me where to look ?

Thanks, and happy new year !

Yann



-- 
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

https://www.cse.buffalo.edu/~knepley/





--
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

https://www.cse.buffalo.edu/~knepley/ 



--
___

Yann JOBIC
HPC engineer
IUSTI-CNRS UMR 7343 - Polytech Marseille
Technopôle de Château Gombert
5 rue Enrico Fermi
13453 Marseille cedex 13
Tel : (33) 4 91 10 69 43
Fax : (33) 4 91 10 69 69



Re: [petsc-users] DMPlex H27 elements

2019-01-05 Thread Matthew Knepley via petsc-users
On Sat, Jan 5, 2019 at 4:04 AM Yann Jobic  wrote:

>
> On 05/01/2019 02:36, Matthew Knepley wrote:
>
> On Fri, Jan 4, 2019 at 10:04 AM Yann Jobic via petsc-users <
> petsc-users@mcs.anl.gov> wrote:
>
>> Dear Petsc Users,
>>
>> I'm using DMPlexCreateFromCellList to create my DM. I would like to have
>> an order 2 geometry.
>>
>> It's working fine in 2D for elements of type Q9.
>>
>
> I do not see how that is possible. The topology does not work that way,
> and there
> is no way a 9 vertex quad was interpolated, so something else is happening.
>
> Moreover, anything you input still has affine geometry. Toby has been
> working on
> non-affine geometry, and all the code is there, but right now you have to
> build and
> populate the coordinate space by hand. What this means is that you create a
> quadratic space for the coordinate DM (rather than the default linear),
> get the
> global coordinate vector out, and stick in the Q9 coordinates. The
> topology is still
> the same no matter what coordinates you read in.
>
> I get the idea. So at the beginning i start with the Q4/H8 dmplex, then i
> fill from the global coordinate vector the missing coordinates, and attach
> this new coordinate vector to the DM.
>
Yes.

> Then the interpolation will be correct ?
>
This is the tricky part. What you likely have to do is:

  1) Build the topology
  2) Run over the cells
  3) For each cell, put in the coordinates using DMPlexVecSetClosure().
This is redundant, but the only way
  you can connect with the Q9 format.

> Can i use DMproject and all the petsc functions ?
>
This is the idea. The amount of testing is so far almost nothing.

> In order to output the results, i've got to write my own vtk interface no
> ? (by splitting the Q9/H27 in 4xQ4 or 8xH8).
>
That is a good question. Right now, it will just output Q4. However,
compared to everything else, writing Q9 should
be comparatively easy.

> Or is it working with the hdf5 one ?
>
I would probably write code to to Xdmf through HDF5 rather than straight
VTK, but we will end up having both.

> Does the p4est interface work with this setup ?
>
It will. I do not know if it currently does. We have to check.

  Thanks,

Matt

>
> We will get around to making an interface for this soon.
>
> Great !
>
> Thanks,
>
> Yann
>
>
>   Thanks,
>
>  Matt
>
>
>> I checked that it's working correctly by using
>> DMPlexComputeCellGeometryFEM, and compute the value of the determinant
>> (CheckMeshGeometry of dm/impls/plex/examples/tutorials/ex2.c)
>>
>> I can import H8 elements, it's working fine.
>>
>> But for H27 element, it's not working. I really don't know how to order
>> my vertex in the cells array. So far, the determinant is zero...
>>
>> I don't know where to look in order to find this information. I tried
>> the function DMPlexGetRawFaces_Internal of the file
>>
>>
>> https://www.mcs.anl.gov/petsc/petsc-current/src/dm/impls/plex/plexinterpolate.c.html#DMPlexGetRawFaces_Internal
>>
>> but it didn't help me.
>>
>> Could you please point me where to look ?
>>
>> Thanks, and happy new year !
>>
>> Yann
>>
>>
>
> --
> 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
>
> https://www.cse.buffalo.edu/~knepley/
> 
>
>

-- 
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

https://www.cse.buffalo.edu/~knepley/ 


Re: [petsc-users] DMPlex H27 elements

2019-01-05 Thread Yann Jobic via petsc-users


On 05/01/2019 02:36, Matthew Knepley wrote:
On Fri, Jan 4, 2019 at 10:04 AM Yann Jobic via petsc-users 
mailto:petsc-users@mcs.anl.gov>> wrote:


Dear Petsc Users,

I'm using DMPlexCreateFromCellList to create my DM. I would like
to have
an order 2 geometry.

It's working fine in 2D for elements of type Q9.


I do not see how that is possible. The topology does not work that 
way, and there
is no way a 9 vertex quad was interpolated, so something else is 
happening.


Moreover, anything you input still has affine geometry. Toby has been 
working on
non-affine geometry, and all the code is there, but right now you have 
to build and
populate the coordinate space by hand. What this means is that you 
create a
quadratic space for the coordinate DM (rather than the default 
linear), get the
global coordinate vector out, and stick in the Q9 coordinates. The 
topology is still

the same no matter what coordinates you read in.


I get the idea. So at the beginning i start with the Q4/H8 dmplex, then 
i fill from the global coordinate vector the missing coordinates, and 
attach this new coordinate vector to the DM. Then the interpolation will 
be correct ? Can i use DMproject and all the petsc functions ?


In order to output the results, i've got to write my own vtk interface 
no ? (by splitting the Q9/H27 in 4xQ4 or 8xH8).


Or is it working with the hdf5 one ?

Does the p4est interface work with this setup ?



We will get around to making an interface for this soon.


Great !

Thanks,

Yann



  Thanks,

     Matt

I checked that it's working correctly by using
DMPlexComputeCellGeometryFEM, and compute the value of the
determinant
(CheckMeshGeometry of dm/impls/plex/examples/tutorials/ex2.c)

I can import H8 elements, it's working fine.

But for H27 element, it's not working. I really don't know how to
order
my vertex in the cells array. So far, the determinant is zero...

I don't know where to look in order to find this information. I tried
the function DMPlexGetRawFaces_Internal of the file


https://www.mcs.anl.gov/petsc/petsc-current/src/dm/impls/plex/plexinterpolate.c.html#DMPlexGetRawFaces_Internal

but it didn't help me.

Could you please point me where to look ?

Thanks, and happy new year !

Yann



--
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

https://www.cse.buffalo.edu/~knepley/ 



[petsc-users] DMPlex H27 elements

2019-01-04 Thread Yann Jobic via petsc-users

Dear Petsc Users,

I'm using DMPlexCreateFromCellList to create my DM. I would like to have 
an order 2 geometry.


It's working fine in 2D for elements of type Q9.

I checked that it's working correctly by using 
DMPlexComputeCellGeometryFEM, and compute the value of the determinant 
(CheckMeshGeometry of dm/impls/plex/examples/tutorials/ex2.c)


I can import H8 elements, it's working fine.

But for H27 element, it's not working. I really don't know how to order 
my vertex in the cells array. So far, the determinant is zero...


I don't know where to look in order to find this information. I tried 
the function DMPlexGetRawFaces_Internal of the file


https://www.mcs.anl.gov/petsc/petsc-current/src/dm/impls/plex/plexinterpolate.c.html#DMPlexGetRawFaces_Internal

but it didn't help me.

Could you please point me where to look ?

Thanks, and happy new year !

Yann