Re: [deal.II] point_value FE_Nedelec

2021-04-22 Thread Wolfgang Bangerth

On 4/22/21 7:11 PM, John Smith wrote:
I have made a silly mistake. Thank you for pointing out this mistake! The 
shape functions indeed look fine!


I apologize for wasting time your time like that …


No worries -- we've all made these sorts of mistakes!
Best
 W.


--

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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/b00f21de-434a-c1d2-5cf3-8f41749f9a80%40colostate.edu.


Re: [deal.II] point_value FE_Nedelec

2021-04-22 Thread John Smith
 

Dear Wolfgang,

I have made a silly mistake. Thank you for pointing out this mistake! The 
shape functions indeed look fine!

I apologize for wasting time your time like that …

Best wishes, 

John


On Friday, April 23, 2021 at 1:21:42 AM UTC+2 Wolfgang Bangerth wrote:

>
> > For the second question: You are absolutely right. I do expect two edge 
> > elements of different degree to be different.
>
> Right, but that does not mean that every shape function of FE_Nedelec(1) 
> must 
> be different from all of the FE_Nedelec(0) shape functions. Some of them 
> may 
> in fact be the same. (c.f. the example of FE_QHierarchical.)
>
> I ran your program, and the shape functions for FE_Nedelec(0) look correct 
> to 
> me, but there are two small mistakes you are making:
> (i) in the figure you show in the other email, your assumptions about
> the order of edges is not correct. It should be this:
>
> *--3--*
> | |
> 0 1
> | |
> *--2--*
>
> (ii) in your little test code, you have these lines where you (try to) 
> reset
> the solution vector:
>
> for (unsigned int i; i < solution.size(); ++i)
> solution(i) = 0;
>
> In this loop, you forget to initialize 'i' to zero at the beginning of
> the loop. If you do, you get the expected results and you will also
> see how this will work for the FE_Nedelec(1).
>
> Best
> Wolfgang
>
>
> -- 
> 
> Wolfgang Bangerth email: bang...@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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/09182bf2-1d1a-4f34-891c-053bf279ed96n%40googlegroups.com.


Re: [deal.II] point_value FE_Nedelec

2021-04-22 Thread Wolfgang Bangerth



For the second question: You are absolutely right. I do expect two edge 
elements of different degree to be different.


Right, but that does not mean that every shape function of FE_Nedelec(1) must 
be different from all of the FE_Nedelec(0) shape functions. Some of them may 
in fact be the same. (c.f. the example of FE_QHierarchical.)


I ran your program, and the shape functions for FE_Nedelec(0) look correct to 
me, but there are two small mistakes you are making:

 (i) in the figure you show in the other email, your assumptions about
 the order of edges is not correct. It should be this:

   *--3--*
   | |
   0 1
   | |
   *--2--*

  (ii) in your little test code, you have these lines where you (try to) reset
   the solution vector:

  for (unsigned int i; i < solution.size(); ++i)
solution(i) = 0;

   In this loop, you forget to initialize 'i' to zero at the beginning of
   the loop. If you do, you get the expected results and you will also
   see how this will work for the FE_Nedelec(1).

Best
 Wolfgang


--

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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/7b72951c-1d66-8f57-c592-0e3161ca311b%40colostate.edu.


Re: [deal.II] point_value FE_Nedelec

2021-04-19 Thread John Smith
 

Dear Wolfgang,

I do not think it is a bug. I think it may very well be that 
VectorTools::point_value it is not meant to be used with FE_Nedelec. 

The first question: in this instance I do not use DataOut at all. I use 
VectorTools::point_value to get data point-by-point and save it into a 
*.csv file.

For the second question: You are absolutely right. I do expect two edge 
elements of different degree to be different. So, I must conclude that my 
knowledge of the edge elements is not correct or is not complete. The last 
brings me to the following quesition:

Is there a paper or a book which describes the exact FE_Nedelec 
implementation of deal.ii?

Best,

John


On Monday, April 19, 2021 at 5:49:24 PM UTC+2 Wolfgang Bangerth wrote:

> On 4/18/21 10:50 PM, John Smith wrote:
> > Then I have fed this solution together with the dof handler to the 
> > VectorTools::point_value on a grid of regularly spaced points. The 
> results 
> > were written into a *.csv file. Then I have made the vector plot out of 
> it. 
> > The 0-th order, FE_Nedelec<2> fe(0), looks just as what I would expect. 
> The 
> > 2-nd order, however, looks just like the 0-th order. I opened the files 
> in 
> > spreadsheet and indeed – the shape functions of the 0-th and 2-nd order 
> are 
> > the same. I ruled out the possibility of mistake (the program prints 
> > fe.degree) and began worrying. I think VectorTools::point_value is to 
> blame 
> > probably…
> > 
> > Is there a replacement for it?
>
> You too quickly jump to the conclusion that the function you called must 
> have 
> a bug. While that's not impossible, you should first run more tests.
>
> All you have shown is that the very first of the shape functions of 
> FE_Nedelec(0) may be the same as the very first shape function of 
> FE_Nedelec(1). But is this really the case? And even if that were so, 
> would 
> that constitute a bug?
>
> For the first question, when you use DataOut to output a finite element 
> field, 
> remember that all you get is a piecewise linear representation of the 
> field. 
> Take a look at the documentation of DataOut::build_patches() to see one 
> would 
> get a more accurate representation.
>
> For the second question: All you need is that the shape functions for 
> higher 
> polynomial degrees are linearly independent of the ones for lower 
> polynomial 
> degrees. While it is true that, for example, for the FE_Q(2) element *all* 
> shape functions are different from the ones of FE_Q(1), this is not a 
> requirement. Take a look at FE_QHierarchical, for example. I don't recall 
> which approach FE_Nedelec takes, but it is at least conceivable that it 
> has 
> the same hierarchical structure.
>
> Best
> W.
>
>
> -- 
> 
> Wolfgang Bangerth email: bang...@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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/96df67df-a740-4812-b058-dc070bcfaa32n%40googlegroups.com.


Re: [deal.II] point_value FE_Nedelec

2021-04-19 Thread Wolfgang Bangerth

On 4/18/21 10:50 PM, John Smith wrote:
Then I have fed this solution together with the dof handler to the 
VectorTools::point_value on a grid of regularly spaced points. The results 
were written into a *.csv file. Then I have made the vector plot out of it. 
The 0-th order, FE_Nedelec<2> fe(0), looks just as what I would expect. The 
2-nd order, however, looks just like the 0-th order. I opened the files in 
spreadsheet and indeed – the shape functions of the 0-th and 2-nd order are 
the same. I ruled out the possibility of mistake (the program prints 
fe.degree) and began worrying. I think VectorTools::point_value is to blame 
probably…


Is there a replacement for it?


You too quickly jump to the conclusion that the function you called must have 
a bug. While that's not impossible, you should first run more tests.


All you have shown is that the very first of the shape functions of 
FE_Nedelec(0) may be the same as the very first shape function of 
FE_Nedelec(1). But is this really the case? And even if that were so, would 
that constitute a bug?


For the first question, when you use DataOut to output a finite element field, 
remember that all you get is a piecewise linear representation of the field. 
Take a look at the documentation of DataOut::build_patches() to see one would 
get a more accurate representation.


For the second question: All you need is that the shape functions for higher 
polynomial degrees are linearly independent of the ones for lower polynomial 
degrees. While it is true that, for example, for the FE_Q(2) element *all* 
shape functions are different from the ones of FE_Q(1), this is not a 
requirement. Take a look at FE_QHierarchical, for example. I don't recall 
which approach FE_Nedelec takes, but it is at least conceivable that it has 
the same hierarchical structure.


Best
 W.


--

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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/6a5c339b-9dff-72a5-5df5-916d8269cd76%40colostate.edu.


Re: [deal.II] point_value FE_Nedelec

2021-04-18 Thread John Smith
 

Yes, I have. Thus the question.

I would like to have a simple silly test to see that the FE_Nedelec 
elements are what I expect them to be. So, I made a simple program similar 
to step-3 that sets up a test. The program uses FE_Nedelec<2>. It does all 
the steps similarly to step-3. However, it does not solve the system of 
linear equations. It substitutes all zeros into the solution vector and 
then makes solution(0) = 1.

Then I have fed this solution together with the dof handler to the 
VectorTools::point_value on a grid of regularly spaced points. The results 
were written into a *.csv file. Then I have made the vector plot out of it. 
The 0-th order, FE_Nedelec<2> fe(0), looks just as what I would expect. The 
2-nd order, however, looks just like the 0-th order. I opened the files in 
spreadsheet and indeed – the shape functions of the 0-th and 2-nd order are 
the same. I ruled out the possibility of mistake (the program prints 
fe.degree) and began worrying. I think VectorTools::point_value is to blame 
probably… 

Is there a replacement for it? 

Best, 

John


On Monday, April 19, 2021 at 4:59:25 AM UTC+2 Wolfgang Bangerth wrote:

> On 4/18/21 7:43 PM, John Smith wrote:
> > 
> > Is VectorTools::point_value supposed to work with FE_Nedelec?
> > 
> > The documentation looks very promising:
> > 
> > Evaluate a possibly vector-valued finite element function defined by the 
> given 
> > DoFHandler 
> > <
> https://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.dealii.org%2Fcurrent%2Fdoxygen%2Fdeal.II%2FclassDoFHandler.html=04%7C01%7CWolfgang.Bangerth%40colostate.edu%7C39054f37290545641e5608d902d486d0%7Cafb58802ff7a4bb1ab21367ff2ecfc8b%7C0%7C0%7C637543934089426552%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000=cfNPiGUOk%2BsIlssgAev6wBAmMiD%2BsZHYrl32blPab0E%3D=0>
>  
>
> > and nodal vector fe_function at the given point point, and return the 
> (vector) 
> > value of this function through the last argument.
>
> John -- have you tried? Oftentimes, just giving it a try is going to 
> answer 
> your question :-)
> Best
> W.
>
>
> -- 
> 
> Wolfgang Bangerth email: bang...@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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/3cfc8137-d48e-4b98-8870-3dab4f64365en%40googlegroups.com.


Re: [deal.II] point_value FE_Nedelec

2021-04-18 Thread Wolfgang Bangerth

On 4/18/21 7:43 PM, John Smith wrote:


Is VectorTools::point_value supposed to work with FE_Nedelec?

The documentation looks very promising:

Evaluate a possibly vector-valued finite element function defined by the given 
DoFHandler 
 
and nodal vector fe_function at the given point point, and return the (vector) 
value of this function through the last argument.


John -- have you tried? Oftentimes, just giving it a try is going to answer 
your question :-)

Best
 W.


--

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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/020523f6-dbe5-82b0-7648-2f6f72348190%40colostate.edu.