Re: [deal.II] Interpolating values of the neighbor cells in DG

2016-09-20 Thread Jiaqi ZHANG
Thank you so much, Praveen. Your codes are really helpful.

Regards,
Jiaqi

2016-09-20 0:11 GMT-04:00 Praveen C :

>
> On Tue, Sep 20, 2016 at 9:34 AM, Jiaqi ZHANG 
> wrote:
>
>> Hello Praveen,
>>
>> Thank you so much. I am wondering if you could tell me which
>>
>> limiters you used, because if it is too hard for me to implement
>>
>> this limiter, I will have to try other ones. I am a newbie to C++,
>>
>> but will try to read your codes to see if I can make it.
>>
>> Thanks,
>> Jiaqi
>>
>
> Hi
>
> I didnt actually complete the implementation of limiter. The closest I
> came is in the first code in 1d_scalar_taylor, see the function
> apply_weno_limiter. It is incomplete though, but shows how I use the new
> reinit function.
>
> Best
> praveen
>
> --
> 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] Interpolating values of the neighbor cells in DG

2016-09-19 Thread Praveen C
On Tue, Sep 20, 2016 at 9:34 AM, Jiaqi ZHANG  wrote:

> Hello Praveen,
>
> Thank you so much. I am wondering if you could tell me which
>
> limiters you used, because if it is too hard for me to implement
>
> this limiter, I will have to try other ones. I am a newbie to C++,
>
> but will try to read your codes to see if I can make it.
>
> Thanks,
> Jiaqi
>

Hi

I didnt actually complete the implementation of limiter. The closest I came
is in the first code in 1d_scalar_taylor, see the function
apply_weno_limiter. It is incomplete though, but shows how I use the new
reinit function.

Best
praveen

-- 
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] Interpolating values of the neighbor cells in DG

2016-09-19 Thread Jiaqi ZHANG
Hello Praveen,

Thank you so much. I am wondering if you could tell me which

limiters you used, because if it is too hard for me to implement

this limiter, I will have to try other ones. I am a newbie to C++,

but will try to read your codes to see if I can make it.

Thanks,
Jiaqi

2016-09-19 23:43 GMT-04:00 Praveen C :

> Hello Jiaqi
>
> I was interested in this some years back though I didnt pursue it after
> some initial attempt.
>
> See this
>
> https://groups.google.com/forum/m/?hl=en-GB#!topic/dealii/gaongNBSXfY
>
> I tried writing an fespace based on FE_DGPNonparametric which does not use
> a mapping and the shape functions are directly evaluated in physical space.
> I attempted it here
>
> https://bitbucket.org/cpraveen/deal_ii/src/f1d8a33d4b5c7af02
> cca8e9e3c7f357d56c4c14d/fe_dgt/?at=master
>
> You need to modify fevalues so that it can use solution on one cell but
> evaluate it on a different cell. See the reinit functions
>
> https://bitbucket.org/cpraveen/deal_ii/src/f1d8a33d4b5c7af02
> cca8e9e3c7f357d56c4c14d/fe_dgt/fe_values.cc?at=master&
> fileviewer=file-view-default
>
> I dont remember clearly but this seemed to be working fine. Only problem
> was that the shape functions were not orthogonal.
>
> I used this fe_dgt space here
>
> https://bitbucket.org/cpraveen/deal_ii/src/f1d8a33d4b5c7af02
> cca8e9e3c7f357d56c4c14d/dg/1d_scalar_taylor/?at=master
>
> https://bitbucket.org/cpraveen/deal_ii/src/f1d8a33d4b5c7af02
> cca8e9e3c7f357d56c4c14d/dg/2d_scalar_unsteady_taylor/?at=master
>
> There may be other discussion in mailing list related to this which I have
> forgotten now.
>
> It *should be possible* to add a similar reinit function to FE_DGP with
> MappingCartesian, and achieve what you want. The shape functions would be
> orthogonal. So one would use it as (some syntax could be wrong here)
>
> fe_values.reinit(cell);
> std::vector& points = fe_values.get_quadrature_points();
> fe_values_nbr.reinit(nbr_cell, points);
>
> The last reinit function should convert "points" to local coordinates on
> nbr_cell and evaluate whatever it wants.
>
> Or you can modify my fe_dgt to use Legendre polynomials.
>
> On general grids, this is more difficult if you want to have orthogonal
> shape functions. Only way would be to implement some gram-schmidt process.
> If you dont care for orthogonality, then something like fe_dgt above works.
>
> Best
> Praveen​
>
> --
> 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.
>



-- 
Jiaqi Zhang
Graduate student
Department of Mathematics
Virginia Tech

-- 
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] Interpolating values of the neighbor cells in DG

2016-09-19 Thread Jiaqi ZHANG
Dear Prof. Bangerth,

I will have to use arbitrary meshes, because I have solid particles moving
in the mesh and

have to refine the mesh adaptively. Later, I will need to move the mesh and
even regenerate

the mesh if the cells are too distorted.

Best,
Jiaqi






2016-09-19 23:26 GMT-04:00 Wolfgang Bangerth :

>
> Jiaqi,
>
> Yes, I want to extend the solution from the neighboring cells to the
>> current
>> cell. I know different cells have different polynomial descriptions,
>> but in order to apply the limiters, information from the neighbor cells is
>> required. Is it possible to extend the solutions from neighbors through
>> interpolation? I am not sure how to do that in deal.II.
>>
>
> This is one of those operations that are easy to write down in formulas
> and difficult to implement.
>
> Are you using arbitrary meshes, or rectangular ones? I ask because what
> you really want to do is evaluate the solution on one cell at points
> *outside this cell*. That's possible, but you will need to know the
> reference coordinates of a point on a neighboring cell in the coordinate
> system of the current cell. This is simple if you are on a rectangular
> mesh, but not so simple in the general case.
>
> 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/fo
> rum/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.
>



-- 
Jiaqi Zhang
Graduate student
Department of Mathematics
Virginia Tech

-- 
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] Interpolating values of the neighbor cells in DG

2016-09-19 Thread Praveen C
Hello Jiaqi

I was interested in this some years back though I didnt pursue it after
some initial attempt.

See this

https://groups.google.com/forum/m/?hl=en-GB#!topic/dealii/gaongNBSXfY

I tried writing an fespace based on FE_DGPNonparametric which does not use
a mapping and the shape functions are directly evaluated in physical space.
I attempted it here

https://bitbucket.org/cpraveen/deal_ii/src/f1d8a33d4b5c7af02
cca8e9e3c7f357d56c4c14d/fe_dgt/?at=master

You need to modify fevalues so that it can use solution on one cell but
evaluate it on a different cell. See the reinit functions

https://bitbucket.org/cpraveen/deal_ii/src/f1d8a33d4b5c7af02cca8e9e3c7f35
7d56c4c14d/fe_dgt/fe_values.cc?at=master=file-view-default

I dont remember clearly but this seemed to be working fine. Only problem
was that the shape functions were not orthogonal.

I used this fe_dgt space here

https://bitbucket.org/cpraveen/deal_ii/src/f1d8a33d4b5c7af02cca8e9e3c7f35
7d56c4c14d/dg/1d_scalar_taylor/?at=master

https://bitbucket.org/cpraveen/deal_ii/src/f1d8a33d4b5c7af02cca8e9e3c7f35
7d56c4c14d/dg/2d_scalar_unsteady_taylor/?at=master

There may be other discussion in mailing list related to this which I have
forgotten now.

It *should be possible* to add a similar reinit function to FE_DGP with
MappingCartesian, and achieve what you want. The shape functions would be
orthogonal. So one would use it as (some syntax could be wrong here)

fe_values.reinit(cell);
std::vector& points = fe_values.get_quadrature_points();
fe_values_nbr.reinit(nbr_cell, points);

The last reinit function should convert "points" to local coordinates on
nbr_cell and evaluate whatever it wants.

Or you can modify my fe_dgt to use Legendre polynomials.

On general grids, this is more difficult if you want to have orthogonal
shape functions. Only way would be to implement some gram-schmidt process.
If you dont care for orthogonality, then something like fe_dgt above works.

Best
Praveen​

-- 
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] Interpolating values of the neighbor cells in DG

2016-09-19 Thread Wolfgang Bangerth


Jiaqi,


Yes, I want to extend the solution from the neighboring cells to the current
cell. I know different cells have different polynomial descriptions,
but in order to apply the limiters, information from the neighbor cells is
required. Is it possible to extend the solutions from neighbors through
interpolation? I am not sure how to do that in deal.II.


This is one of those operations that are easy to write down in formulas and 
difficult to implement.


Are you using arbitrary meshes, or rectangular ones? I ask because what you 
really want to do is evaluate the solution on one cell at points *outside this 
cell*. That's possible, but you will need to know the reference coordinates of 
a point on a neighboring cell in the coordinate system of the current cell. 
This is simple if you are on a rectangular mesh, but not so simple in the 
general case.


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] Interpolating values of the neighbor cells in DG

2016-09-19 Thread Jiaqi ZHANG
Dear Prof. Bangerth,

Thanks for the fast reply.

Yes, I want to extend the solution from the neighboring cells to the
current cell. I know different cells have different polynomial
descriptions,

but in order to apply the limiters, information from the neighbor cells is
required. Is it possible to extend the solutions from neighbors through

interpolation? I am not sure how to do that in deal.II.


Thanks,
Jiaqi

2016-09-19 17:36 GMT-04:00 Wolfgang Bangerth :

> On 09/19/2016 03:15 PM, Jiaqi ZHANG wrote:
>
>>
>> I was trying to get the values of the solution polynomial in the
>> neighbor cells in DG,
>>
>> for example, I want to compute
>> View the MathML source
>>
>> where p_i are the solution polynomials of the neighbors, \Delta_0 is the
>> current cell.
>>
>> I cannot find any function to do this in Finite elements
>>  » Finite
>> element access/FEValues classes
>> 
>>
>> How should I implement this in deal.II?
>>
>
> You mean that you want to *extend the solution from the neighboring cell
> to the current cell*? In general, the polynomials that describe the
> solution are of course only defined on one cell, and there is a separate
> polynomial description on the neighboring cell.
>
> 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/fo
> rum/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] Interpolating values of the neighbor cells in DG

2016-09-19 Thread Wolfgang Bangerth

On 09/19/2016 03:15 PM, Jiaqi ZHANG wrote:


I was trying to get the values of the solution polynomial in the
neighbor cells in DG,

for example, I want to compute
View the MathML source

where p_i are the solution polynomials of the neighbors, \Delta_0 is the
current cell.

I cannot find any function to do this in Finite elements
 » Finite
element access/FEValues classes


How should I implement this in deal.II?


You mean that you want to *extend the solution from the neighboring cell 
to the current cell*? In general, the polynomials that describe the 
solution are of course only defined on one cell, and there is a separate 
polynomial description on the neighboring cell.


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