Re: [deal.II] The shape function on physical cell in hexahedral is not parallel with the edge (FeNedelecSZ and FENedelec)

2019-05-07 Thread Phạm Ngọc Kiên
Hi all,
It was a long time since the last time I posted my test for shape function
in 3D here.
This time I send you the results when testing with a more simple model in
2D, and the shape functions are still wrong with non-rectangle mesh.
The codes print results in this form:
dof i_th: 7
edge number: 3
edge vertices:
1 -1 and 0.5 -1
vector from first to second vertex of the edge: -0.5 0
shape functions on real cell:
0 0
0 0
0 0
1.2 1.29551
1.25 0.81524
1.3 0.0147947
2 2.15918
2 1.30438
2 0.022192

Here I use QGaussLobatto to get a certain shape function on the edge of a
cell.
It takes me so many times for testing where my codes return wrong solutions.
I think, in deal.II 9.0, the shape functions, defined in the two classes
FE_Nedelec and FE_NedelecSZ, are only work with structured grid (i.e. cube
in 3D and rectangle in 2D).
I hope it worth mentioning to fix this problem as we all want to carry out
finite element method with unstructured grid.

Best,
Pham Ngoc Kien

Vào Th 3, 16 thg 4, 2019 vào lúc 14:43 Phạm Ngọc Kiên <
ngockien.lea...@gmail.com> đã viết:

> Hi,
> I have written this code for testing purpose.
> In case of a rotated cube, the shape functions seemed to be good as they
> were parallel to the edge, although there was some small round-off errors
> at the value 0.
> However, when I tested with the grid which was loaded from GMSH, the shape
> functions failed.
> In the attachment, I showed the information for the first active cell
> only. It is easy to get information of other cells with the codes.
>
> I think that there exists something wrong with the cell that are not a
> cube, but a hexahedron when initializing the shape functions (fe_values).
>
> I think it would be easier for you to help me with the attachment below.
> Thank you very much.
> Best regards.
> Pham Ngoc Kien
>
> Vào Th 2, 15 thg 4, 2019 vào lúc 21:48 Wolfgang Bangerth <
> bange...@colostate.edu> đã viết:
>
>> On 4/11/19 9:17 PM, Phạm Ngọc Kiên wrote:
>> > Testing for an edge whose global vertices located from (0,0,0) to
>> (0,0,1) in
>> > real coordinates.
>> > With a cube I get the shape function vectors at the dof related to the
>> edge,
>> > for examples, (0,0,0), (0,0,-0.25), (0,0,-0.5), (0,0,-1), which are
>> parallel
>> > to the edge.
>> > However, if I create a mesh with GMSH and check the shape function
>> vectors,
>> > some of them are: (-0.0868383, -0.428, 1), (-0.129933, -0.402772, 1),
>> > (-0.052103 -0.2568 0.6),..,
>> > which are not parallel to the edge.
>> >
>> > In my limited opinion, I will get the wrong solution as the shape
>> functions
>> > created by my code are not parallel to the edge in my model.
>> > Could you please tell me why this happen and how to fix it?
>>
>> Good question. This does sound wrong. To figure out what is happening
>> exactly,
>> we typically construct small test cases that try to illustrate one
>> particular
>> issue. In your case, I would try to create a mesh with exactly one cell
>> --
>> either the one you have above, or maybe even simpler a cube that is just
>> rotated. Then create a DoFHandler on it and output the values of the
>> shape
>> functions. This way, you really have only one thing that could go wrong,
>> and
>> it's easy to demonstrate what you see and how it differs from
>> expectations.
>>
>> Do you think you could come up with a small program that does this?
>>
>> Best
>>   WB
>>
>> --
>> 
>> Wolfgang Bangerth  email: bange...@colostate.edu
>> www: http://www.math.colostate.edu/~bangerth/
>>
>> --
>> The deal.II project is located at http://www.dealii.org/
>> For mailing list/forum options, see
>> https://groups.google.com/d/forum/dealii?hl=en
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "deal.II User Group" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to dealii+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see 
https://groups.google.com/d/forum/dealii?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to dealii+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/CAAo%2BSZf2hqW7DixnW6AHb3hiHPn4KsW8xK9qCaXzRzPJg_S5ZQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


2d testing.msh
Description: Mesh model
/* -
 *
 * Copyright (C) 2013 - 2018 by the deal.II authors
 *
 * This file is part of the deal.II library.
 *
 * The deal.II library is free software; you can use it, redistribute
 * it, and/or modify it 

Re: [deal.II] Periodic boundary conditions and the AffineConstraints class

2019-05-07 Thread Bruno Blais
Indeed it was my mistake, sorry :)


On Monday, 6 May 2019 01:48:23 UTC-4, Matthias Maier wrote:
>
>
> On Sun, May  5, 2019, at 22:47 CDT, Bruno Blais  > wrote: 
>
> > I am trying to implement periodic boundary conditions in my CFD solver. 
> > When looking at the documentation for the make_periodicity_constraints I 
> > see that the contraints have to be of type ConstraintsMatrix instead of 
> > type AffineConstraints (or another type) 
>
> > Is this a current issue or it is better to stick with ConstraintsMatrix 
> for 
> > the time being? 
>
> You have probably looked at different release versions for both 
> classes. We have renamed ConstraintMatrix to AffineConstraints (and made 
> ConstraintMatrix a type alias for AffineConstraints). 
>
> The function make_periodicity_constraints will thus of course work with 
> AffineConstraints. 
>
> Best, 
> Matthias 
>

-- 
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see 
https://groups.google.com/d/forum/dealii?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to dealii+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/f45306aa-8395-4f5b-aabc-a35e9d22e8f9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.