Re: [deal.II] Re: How to get the coordinates of a given degree of freedom on an edge?

2019-02-21 Thread Phạm Ngọc Kiên
Hi,
The attachment is my small program that I created.
My fe system have 24 dofs for both real and imaginary of 12 edges of a cell.
No matter how I change the parameter "order" the number of dofs is
unchanged.
I think I have problem when constructing the object.
I would like to thank you very much.
 Best,
Kien

Vào Th 5, 21 thg 2, 2019 vào lúc 23:38 Wolfgang Bangerth <
bange...@colostate.edu> đã viết:

> On 2/20/19 7:01 PM, Phạm Ngọc Kiên wrote:
> > I tested in my codes using
> >
> > template
> > CSEM::CSEM()
> >  ://mapping(1),
> > dof_handler(triangulation),
> >  fe(FE_NedelecSZ(order),1,//(order), multiplicity
> > FE_NedelecSZ(order),1) {}
> >
> > When I changed the parameter order, I saw only the number of dofs was
> only of lowest order dofs no matter how big the order was
> >
> > I think that there should be a way to get higher order dofs, but I
> cannot find it now.
>
> Can you create a small program that demonstrates this issue?
>
> 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.
> 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.
For more options, visit https://groups.google.com/d/optout.
/* -
 *
 * 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 under the terms of the GNU Lesser General
 * Public License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 * The full text of the license can be found in the file LICENSE.md at
 * the top level directory of deal.II.
 *
 * -


 */

#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 

#include 
#include 
#include 

#include 
#include 
#include 
#include 

#include 
#include 
#include 


#include 
#include 
#include 
#include 
#include 

#include 
#include 
#include 
#include 


#include 
#include 

#include 


#include 
#include 
#include 

#include 
#include 
#include 

using namespace dealii;

template
class EM {
public:
EM();


~EM();

void run();


private:
void grid_generation();

void setup_system();

void assemble_system();

void solve();



Triangulation triangulation;

DoFHandler dof_handler;
FESystem fe;

AffineConstraints constraints;

SparsityPattern sparsity_pattern;
SparseMatrix system_matrix;

Vector solution;
Vector system_rhs;

const unsigned int order = 3; //order of edge-based element

};

template
EM::EM()
:dof_handler(triangulation),
 fe(FE_NedelecSZ(order), 1,   //(order), multiplicity
FE_NedelecSZ(order), 1) {}

template
EM::~EM() {
dof_handler.clear();
}

template
void EM::grid_generation() {
GridGenerator::hyper_cube(triangulation, -4, 4);
}

template
void EM::setup_system() {
dof_handler.distribute_dofs(fe);

solution.reinit(dof_handler.n_dofs());
system_rhs.reinit(dof_handler.n_dofs());

constraints.clear();
DoFTools::make_hanging_node_constraints(dof_handler, constraints);

VectorTools::project_boundary_values_curl_conforming_l2(dof_handler,
0,
ConstantFunction(0., fe.n_components()),
1,  
constraints);
VectorTools::project_boundary_values_curl_conforming_l2(dof_handler,
dim,
ConstantFunction(0., fe.n_components()),
1, 
constraints);
constraints.close();


Re: [deal.II] Re: How to get the coordinates of a given degree of freedom on an edge?

2019-02-21 Thread Wolfgang Bangerth
On 2/20/19 7:01 PM, Phạm Ngọc Kiên wrote:
> I tested in my codes using
> 
> template
> CSEM::CSEM()
>  ://mapping(1),
> dof_handler(triangulation),
>  fe(FE_NedelecSZ(order),1,//(order), multiplicity
> FE_NedelecSZ(order),1) {}
> 
> When I changed the parameter order, I saw only the number of dofs was only of 
> lowest order dofs no matter how big the order was
> 
> I think that there should be a way to get higher order dofs, but I cannot 
> find it now.

Can you create a small program that demonstrates this issue?

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.
For more options, visit https://groups.google.com/d/optout.


Re: [deal.II] Re: How to get the coordinates of a given degree of freedom on an edge?

2019-02-20 Thread Phạm Ngọc Kiên
Dear Daniel,
I think that I can address my problem with the source now after looking
through the way we create dofs in FE_NedelecSZ.
I tested in my codes using

template
CSEM::CSEM()
://mapping(1),
dof_handler(triangulation),
fe(FE_NedelecSZ(order), 1,   //(order), multiplicity
   FE_NedelecSZ(order), 1) {}

When I changed the parameter order, I saw only the number of dofs was
only of lowest order dofs no matter how big the order was

I think that there should be a way to get higher order dofs, but I
cannot find it now.

Thank you very much.


Vào Th 4, 20 thg 2, 2019 vào lúc 18:54 Daniel Arndt <
daniel.ar...@iwr.uni-heidelberg.de> đã viết:

> Kien,
>
> I am not quite sure I understand how the source term you want to use looks
> like.
>
> If you want to describe a point source, you should gave a look at
> https://www.dealii.org/developer/doxygen/deal.II/namespaceVectorTools.html#ac4ffc41e72e846029d04e7034de60d09
> .
> Be aware of the last paragraphs in its documentation, though.
>
> On the other hand, if you have a usual right hand side Js(x), you need to
> follow the approach Wolfgang described and that is used in almost all
> tutorial progams,
> e.g.
> https://www.dealii.org/developer/doxygen/deal.II/step_4.html#Step4assemble_system
> .
>
> How does Js(x) look like?
>
> I also tried to use FE_NedelecSZ(order) with different order.
>> And I saw that no matter how I change the order value, the functions
>> fe.n_dofs_per_quad() and fe.n_dofs_per_hex() returned 0. The number of dofs
>> was unchanged and was equal to fe.n_dofs_per_line().
>> Does this mean that there is no face and cell dof?
>>
> According to the implementation there should be
> - 0 dofs per vertex
> - degree+1 dofs per line
> - 2*degree*(degree+1) dofs per quad
> - 3*degree*degree*(degree+1) dofs per hex
>
>
>> Do I need to use hp::DoFHandler to get the higher order dofs for
>> calculation?
>>
> No, you would use this if you want to use a different ansatz space, e.g.
> the same type of element with a different polynomial degree, for each cell.
>
>  Best,
> Daniel
>
> --
> 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.
For more options, visit https://groups.google.com/d/optout.


Re: [deal.II] Re: How to get the coordinates of a given degree of freedom on an edge?

2019-02-20 Thread Daniel Arndt
Kien,

I am not quite sure I understand how the source term you want to use looks 
like.

If you want to describe a point source, you should gave a look at 
https://www.dealii.org/developer/doxygen/deal.II/namespaceVectorTools.html#ac4ffc41e72e846029d04e7034de60d09.
Be aware of the last paragraphs in its documentation, though.

On the other hand, if you have a usual right hand side Js(x), you need to 
follow the approach Wolfgang described and that is used in almost all 
tutorial progams,
e.g. 
https://www.dealii.org/developer/doxygen/deal.II/step_4.html#Step4assemble_system.

How does Js(x) look like?

I also tried to use FE_NedelecSZ(order) with different order. 
> And I saw that no matter how I change the order value, the functions 
> fe.n_dofs_per_quad() and fe.n_dofs_per_hex() returned 0. The number of dofs 
> was unchanged and was equal to fe.n_dofs_per_line().
> Does this mean that there is no face and cell dof?
>
According to the implementation there should be
- 0 dofs per vertex
- degree+1 dofs per line
- 2*degree*(degree+1) dofs per quad
- 3*degree*degree*(degree+1) dofs per hex
 

> Do I need to use hp::DoFHandler to get the higher order dofs for 
> calculation?
>
No, you would use this if you want to use a different ansatz space, e.g. 
the same type of element with a different polynomial degree, for each cell.

 Best,
Daniel

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


Re: [deal.II] Re: How to get the coordinates of a given degree of freedom on an edge?

2019-02-19 Thread Phạm Ngọc Kiên
Yes.
Let me go from my basic idea when setting up my source term.
First, I create a computational domain such that a source can be placed
exactly on an edge. It is always possible to do with unstructured meshes.
Then I go through each element and check if its edge overlap the source. If
it does then I will assign a source moment to the edge.
My problem now is to find out if any edge of an element is overlapped by
the my source.

I thought about finding the position of the degree of freedom in a cell (in
real co-ordinate) and check if its real position is my source position.
Thus, I sent a question about this.

I have checked my codes and saw that \varphi_i(x) were a vector at
quadrature point x for the i_th degree of freedom.
It determines the direction of my vector field on the i_th degree of
freedom in reference cell.
So, I set Js(x) is a vector of the same size to compute the right hand side.

I think there is no problem for the FE_NedelecSZ element. My code still run
but it do not give me an exact solution compared with analytic one because
it is not true if I set the same Js(x) for every dof in a cell containing
the source point.


I also tried to use FE_NedelecSZ(order) with different order.
And I saw that no matter how I change the order value, the functions
fe.n_dofs_per_quad() and fe.n_dofs_per_hex() returned 0. The number of dofs
was unchanged and was equal to fe.n_dofs_per_line().
Does this mean that there is no face and cell dof?
Do I need to use hp::DoFHandler to get the higher order dofs for
calculation?

Thank you very much.
Best,
Kien

Vào Th 4, 20 thg 2, 2019 vào lúc 07:44 Wolfgang Bangerth <
bange...@colostate.edu> đã viết:

> On 2/19/19 12:03 AM, Phạm Ngọc Kiên wrote:
> > I currently try to solve the electromagnetics problem, followed by the
> > research of Ross Kynch.
> > My goal is to compute the right hand side for the problem:
> > curl curl E + i*omega*mu*sigma*E = - Js
> > I only want to set the Js term here to be none zero, for example to be
> > 1, at a given degree of freedom (i.e. at source position), and  0
> > everywhere else.
> > Thus, I need to write the codes to query if a degree of freedom is at
> > source position.
> > As you mentioned, now I think that I need to check if the source point
> > is on an edge when assembling the right hand side vector.
> > Could you please tell me help me about this?
>
> The term you are trying to add (Js) is a right hand side term to the
> equation. So you need to compute the vector
>
>F_i  =  - \int_Omega  \varphi_i(x)  Js(x)  dx
>
> for which you only need to be able to evaluate Js(x) and \varphi_i(x) at
> quadrature points x, but not a specific support points. This is no
> problem for the FE_NedelecSZ element. Can you explain why this does not
> work for you?
>
> 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.
> 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.
For more options, visit https://groups.google.com/d/optout.


Re: [deal.II] Re: How to get the coordinates of a given degree of freedom on an edge?

2019-02-19 Thread Wolfgang Bangerth
On 2/19/19 12:03 AM, Phạm Ngọc Kiên wrote:
> I currently try to solve the electromagnetics problem, followed by the 
> research of Ross Kynch.
> My goal is to compute the right hand side for the problem:
> curl curl E + i*omega*mu*sigma*E = - Js
> I only want to set the Js term here to be none zero, for example to be 
> 1, at a given degree of freedom (i.e. at source position), and  0 
> everywhere else.
> Thus, I need to write the codes to query if a degree of freedom is at 
> source position.
> As you mentioned, now I think that I need to check if the source point 
> is on an edge when assembling the right hand side vector.
> Could you please tell me help me about this?

The term you are trying to add (Js) is a right hand side term to the 
equation. So you need to compute the vector

   F_i  =  - \int_Omega  \varphi_i(x)  Js(x)  dx

for which you only need to be able to evaluate Js(x) and \varphi_i(x) at 
quadrature points x, but not a specific support points. This is no 
problem for the FE_NedelecSZ element. Can you explain why this does not 
work for you?

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.
For more options, visit https://groups.google.com/d/optout.


Re: [deal.II] Re: How to get the coordinates of a given degree of freedom on an edge?

2019-02-18 Thread Phạm Ngọc Kiên
Dear Prof. Wolfgang Bangerth,
I would like to thank you very much.
I am reading through the FE_NedelecSZ codes in Deal.II library.
I currently try to solve the electromagnetics problem, followed by the
research of Ross Kynch.
My goal is to compute the right hand side for the problem:
curl curl E + i*omega*mu*sigma*E = - Js
I only want to set the Js term here to be none zero, for example to be 1,
at a given degree of freedom (i.e. at source position), and  0 everywhere
else.
Thus, I need to write the codes to query if a degree of freedom is at
source position.
As you mentioned, now I think that I need to check if the source point is
on an edge when assembling the right hand side vector.
Could you please tell me help me about this?
Best regards,
Pham Ngoc Kien

Vào Th 3, 19 thg 2, 2019 vào lúc 15:45 Wolfgang Bangerth <
bange...@colostate.edu> đã viết:

> On 2/18/19 10:47 PM, Phạm Ngọc Kiên wrote:
> >
> > 2. I have tried some thing with the third method. And here-below is my
> code:
> >
> > Point p{0.5,0.5,0.5};//position in reference cell
> > Quadrature q(p);
> > FEValues fe_values_q(fe, q,update_quadrature_points);
> > fe_values_q.reinit(cell);
> >
> > //position in the real cell
> > std::vector> dof_pos = fe_values_q.get_quadrature_points();
> > for (int k =0; k  >  for (int j =0; j  >  std::cout< >  std::cout<<"\n";
> >  }
> > }
> >
> >  From this codes, I can get the real position of arbitrary points in my
> current reference cell.
> >
> > However, my purpose is to get the real position of a given degree of
> freedom.
> >
> > Could you please tell me how to get the position of a degree of freedom
> in the reference cell?
>
> The problem is that the NedelecSZ element does not have any such position.
> You
> are thinking of Lagrange elements (or the regular Nedelec elements) for
> which
> every shape function has a specific location where it is defined: It is
> one
> there, and zero at all other such locations. This is what we call "support
> points" in deal.II.
>
> But the NedelecSZ element is not defined this way (at least that's what I
> believe to be the case). Rather, shape functions are defined in such a way
> that certain *integrals* (rather than *point values*) are zero or one for
> all
> shape functions. As a consequence, there are no support points: Shape
> functions (and degrees of freedom) are not defined at individual points,
> but
> at whole edges.
>
> This means that your approach can not work. I don't know what you want to
> do,
> but let's start with that: What is your *goal*? Maybe then we can think
> about
> how to achieve it!
>
> 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.
> 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.
For more options, visit https://groups.google.com/d/optout.


Re: [deal.II] Re: How to get the coordinates of a given degree of freedom on an edge?

2019-02-18 Thread Wolfgang Bangerth
On 2/18/19 10:47 PM, Phạm Ngọc Kiên wrote:
> 
> 2. I have tried some thing with the third method. And here-below is my code:
> 
> Point p{0.5,0.5,0.5};//position in reference cell
> Quadrature q(p);
> FEValues fe_values_q(fe, q,update_quadrature_points);
> fe_values_q.reinit(cell);
> 
> //position in the real cell
> std::vector> dof_pos = fe_values_q.get_quadrature_points();
> for (int k =0; k   for (int j =0; j   std::cout<  std::cout<<"\n";
>  }
> }
> 
>  From this codes, I can get the real position of arbitrary points in my 
> current reference cell.
> 
> However, my purpose is to get the real position of a given degree of freedom.
> 
> Could you please tell me how to get the position of a degree of freedom in 
> the reference cell?

The problem is that the NedelecSZ element does not have any such position. You 
are thinking of Lagrange elements (or the regular Nedelec elements) for which 
every shape function has a specific location where it is defined: It is one 
there, and zero at all other such locations. This is what we call "support 
points" in deal.II.

But the NedelecSZ element is not defined this way (at least that's what I 
believe to be the case). Rather, shape functions are defined in such a way 
that certain *integrals* (rather than *point values*) are zero or one for all 
shape functions. As a consequence, there are no support points: Shape 
functions (and degrees of freedom) are not defined at individual points, but 
at whole edges.

This means that your approach can not work. I don't know what you want to do, 
but let's start with that: What is your *goal*? Maybe then we can think about 
how to achieve it!

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.
For more options, visit https://groups.google.com/d/optout.


Re: [deal.II] Re: How to get the coordinates of a given degree of freedom on an edge?

2019-02-18 Thread Phạm Ngọc Kiên
I am sorry as my question is not clear enough.
What I mean is when we loop over all degree of freedom in a cell, for
example,

for (unsigned int i = 0; i < dofs_per_cell; ++i) { .. }

Do we have any method to get the position of the i_th degree of
freedom inside this loop?

I would like to thank you very much!

Best,

Pham Ngoc Kien


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

> Hi,
> I have tried with the methods described in the FAQ and figured out that:
> 1. As I used edge-based element (FE_NedelecSZ), I queried if my element
> had support points by  *fe.has_support_points()*. As a consequence, it
> returned zero.
> The *FiniteElement::get_unit_support_points() *also returned an empty
> vector.
> As there was no support point, DoFTools::map_dofs_to_support_points()
> could not work as you mentioned above.
>
> 2. I have tried some thing with the third method. And here-below is my
> code:
>
> Point p{0.5,0.5,0.5}; //position in reference cell
> Quadrature q(p);
> FEValues fe_values_q(fe, q, update_quadrature_points);
> fe_values_q.reinit(cell);
>
> //position in the real cell
> std::vector> dof_pos = fe_values_q.get_quadrature_points();
> for (int k = 0; k  for (int j = 0; j  std::cout< std::cout<<"\n";
> }
> }
>
> From this codes, I can get the real position of arbitrary points in my 
> current reference cell.
>
> However, my purpose is to get the real position of a given degree of freedom.
>
> Could you please tell me how to get the position of a degree of freedom in 
> the reference cell?
>
> Thank you very much for your help.
>
> Best,
>
> Pham Ngoc Kien
>
>
> Vào Th 3, 19 thg 2, 2019 vào lúc 11:47 Phạm Ngọc Kiên <
> ngockien.lea...@gmail.com> đã viết:
>
>> Yes, thank you very much.
>> I will dig deeper into this.
>> Best,
>> Pham Ngoc Kien
>>
>> Vào Th 3, 19 thg 2, 2019 vào lúc 11:23 Bruno Turcksin <
>> bruno.turck...@gmail.com> đã viết:
>>
>>> Pham Ngoc Kien,
>>>
>>> Le lun. 18 févr. 2019 à 19:33, Phạm Ngọc Kiên 
>>> a écrit :
>>>
 With the DoFTools::map_dofs_to_support_points() , I saw in the library
 manual that it can be used with no edge elements or the like.
 As my finite element is edge-based one, I wonder if this function work?

>>> No the function won't work but there are two other methods described in
>>> the FAQ that you could use. In particular, you can create a special
>>> quadrature at the points of interest.
>>>
>>> Best,
>>>
>>> Bruno
>>>
>>> --
>>> 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.
For more options, visit https://groups.google.com/d/optout.


Re: [deal.II] Re: How to get the coordinates of a given degree of freedom on an edge?

2019-02-18 Thread Phạm Ngọc Kiên
Hi,
I have tried with the methods described in the FAQ and figured out that:
1. As I used edge-based element (FE_NedelecSZ), I queried if my element had
support points by  *fe.has_support_points()*. As a consequence, it returned
zero.
The *FiniteElement::get_unit_support_points() *also returned an empty
vector.
As there was no support point, DoFTools::map_dofs_to_support_points() could
not work as you mentioned above.

2. I have tried some thing with the third method. And here-below is my code:

Point p{0.5,0.5,0.5}; //position in reference cell
Quadrature q(p);
FEValues fe_values_q(fe, q, update_quadrature_points);
fe_values_q.reinit(cell);

//position in the real cell
std::vector> dof_pos = fe_values_q.get_quadrature_points();
for (int k = 0; k From this codes, I can get the real position of arbitrary points in my
current reference cell.

However, my purpose is to get the real position of a given degree of freedom.

Could you please tell me how to get the position of a degree of
freedom in the reference cell?

Thank you very much for your help.

Best,

Pham Ngoc Kien


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

> Yes, thank you very much.
> I will dig deeper into this.
> Best,
> Pham Ngoc Kien
>
> Vào Th 3, 19 thg 2, 2019 vào lúc 11:23 Bruno Turcksin <
> bruno.turck...@gmail.com> đã viết:
>
>> Pham Ngoc Kien,
>>
>> Le lun. 18 févr. 2019 à 19:33, Phạm Ngọc Kiên 
>> a écrit :
>>
>>> With the DoFTools::map_dofs_to_support_points() , I saw in the library
>>> manual that it can be used with no edge elements or the like.
>>> As my finite element is edge-based one, I wonder if this function work?
>>>
>> No the function won't work but there are two other methods described in
>> the FAQ that you could use. In particular, you can create a special
>> quadrature at the points of interest.
>>
>> Best,
>>
>> Bruno
>>
>> --
>> 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.
For more options, visit https://groups.google.com/d/optout.


Re: [deal.II] Re: How to get the coordinates of a given degree of freedom on an edge?

2019-02-18 Thread Phạm Ngọc Kiên
Yes, thank you very much.
I will dig deeper into this.
Best,
Pham Ngoc Kien

Vào Th 3, 19 thg 2, 2019 vào lúc 11:23 Bruno Turcksin <
bruno.turck...@gmail.com> đã viết:

> Pham Ngoc Kien,
>
> Le lun. 18 févr. 2019 à 19:33, Phạm Ngọc Kiên 
> a écrit :
>
>> With the DoFTools::map_dofs_to_support_points() , I saw in the library
>> manual that it can be used with no edge elements or the like.
>> As my finite element is edge-based one, I wonder if this function work?
>>
> No the function won't work but there are two other methods described in
> the FAQ that you could use. In particular, you can create a special
> quadrature at the points of interest.
>
> Best,
>
> Bruno
>
> --
> 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.
For more options, visit https://groups.google.com/d/optout.


Re: [deal.II] Re: How to get the coordinates of a given degree of freedom on an edge?

2019-02-18 Thread Bruno Turcksin
Pham Ngoc Kien,

Le lun. 18 févr. 2019 à 19:33, Phạm Ngọc Kiên  a
écrit :

> With the DoFTools::map_dofs_to_support_points() , I saw in the library
> manual that it can be used with no edge elements or the like.
> As my finite element is edge-based one, I wonder if this function work?
>
No the function won't work but there are two other methods described in the
FAQ that you could use. In particular, you can create a special quadrature
at the points of interest.

Best,

Bruno

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


Re: [deal.II] Re: How to get the coordinates of a given degree of freedom on an edge?

2019-02-18 Thread Phạm Ngọc Kiên
Hi Bruno,
With the DoFTools::map_dofs_to_support_points() , I saw in the library
manual that it can be used with no edge elements or the like.
As my finite element is edge-based one, I wonder if this function work?
I have check the function fe.has_support_points() in my code and it
returned 0.
That is the reason why I put my question.
Thank you very much for your suggestion.

Best,
Pham Ngoc Kien

Vào Th 3, 19 thg 2, 2019 vào lúc 06:18 Bruno Turcksin <
bruno.turck...@gmail.com> đã viết:

> Hi,
>
> Take a look at this entry
> 
> in the FAQ.
>
> Best,
>
> Bruno
>
> On Monday, February 18, 2019 at 12:20:48 AM UTC-5, Phạm Ngọc Kiên wrote:
>>
>> Dear colleagues,
>> I am working with FE_Nedelec_SZ element (edge-based finite element) in
>> Deal.II (version 9.0.0).
>> For my current problem, I need to get the global coordinates of a given
>> degree of freedom on and edge.
>> Do we have any code for this task?
>>
>> I have also thought of using material_id for an edge as an alternative
>> way to address my problem. However, I personally think that the material_id
>> can be used only with a cell.
>>
>> I would like to thank you very much in advance.
>>
>> Pham Ngoc Kien
>> Ph.D. student
>> Seoul National University
>>
> --
> 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.
For more options, visit https://groups.google.com/d/optout.


[deal.II] Re: How to get the coordinates of a given degree of freedom on an edge?

2019-02-18 Thread Bruno Turcksin
Hi,

Take a look at this entry 

 
in the FAQ.

Best,

Bruno

On Monday, February 18, 2019 at 12:20:48 AM UTC-5, Phạm Ngọc Kiên wrote:
>
> Dear colleagues,
> I am working with FE_Nedelec_SZ element (edge-based finite element) in 
> Deal.II (version 9.0.0).
> For my current problem, I need to get the global coordinates of a given 
> degree of freedom on and edge. 
> Do we have any code for this task?
>
> I have also thought of using material_id for an edge as an alternative way 
> to address my problem. However, I personally think that the material_id can 
> be used only with a cell.
>
> I would like to thank you very much in advance.
>
> Pham Ngoc Kien
> Ph.D. student
> Seoul National University
>

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