Meshworker

42 views
Skip to first unread message

Sudarshan Kumar

unread,
Nov 17, 2016, 10:03:55 PM11/17/16
to deal.II User Group

 we choose dim=2

template <int dim>
void Step12<dim>::integrate_face_term (DoFInfo& dinfo1, DoFInfo& dinfo2,
                                           CellInfo& info1, CellInfo& info2)
{
   const FEValuesBase<dim>& fe_v          = info1.fe_values();
   const FEValuesBase<dim>& fe_v_neighbor = info2.fe_values();
  
   const std::vector<double>& sol1 = info1.values[0][0];
   const std::vector<double>& sol2 = info2.values[0][0];



In the above  call,  sol1 and sol2  reference to the solution values only at the face of cell1 and cell2.

Is it possible to extract the solution values  in the interior of cell1 and cell2 in the above function ??

Help is appreciated

Thanks a lot,

Daniel Arndt

unread,
Nov 18, 2016, 4:58:47 AM11/18/16
to deal.II User Group
Sudarshan,


template <int dim>
void Step12<dim>::integrate_face_term (DoFInfo& dinfo1, DoFInfo& dinfo2,
                                           CellInfo& info1, CellInfo& info2)
{
   const FEValuesBase<dim>& fe_v          = info1.fe_values();
   const FEValuesBase<dim>& fe_v_neighbor = info2.fe_values();
  
   const std::vector<double>& sol1 = info1.values[0][0];
   const std::vector<double>& sol2 = info2.values[0][0];



In the above  call,  sol1 and sol2  reference to the solution values only at the face of cell1 and cell2.
More precisely, sol1 and sol2 contain the values at the quadrature points which happen to be on a face when you want to integrate a face term.

Is it possible to extract the solution values  in the interior of cell1 and cell2 in the above function ??
No that easily. Why do you need this? How does the face term you are interested in look like?

Best,
Daniel

Sudarshan Kumar

unread,
Nov 18, 2016, 7:15:44 AM11/18/16
to deal.II User Group
Dear   Daniel,

  When I am at the face  I need the solution at the interior  quadrature  points as well.  However from  dinfo1.indices   we could get the  the dof indices for the cell1. But  is it possible to get the shape value at the interior quadrature points ?

Thanks a lot

Daniel Arndt

unread,
Nov 20, 2016, 7:49:47 AM11/20/16
to deal.II User Group
Sudarshan,


  When I am at the face  I need the solution at the interior  quadrature  points as well.  However from  dinfo1.indices   we could get the  the dof indices for the cell1. But  is it possible to get the shape value at the interior quadrature points ?
You can of course work around this by creating FEValues objects fe_values_1 and fe_values_2 with the same quadrature rule you are using for the cell_integrators  and call
fe_values_1.reinit(dinfo1.cell);
fe_values_2.reinit(dinfo2.cell);
These objects can then be used to get the shape values at the interior quadrature points. Still it sounds weird that you would need to have these values. What are you trying to do?

Best,
Daniel

sudarshan kumar

unread,
Nov 22, 2016, 8:13:24 AM11/22/16
to dea...@googlegroups.com

Dear   Daniel,


Thanks  a  lot, yes  it works.  In fact I am working on time dependent problem, and so in my method I need an adjacent interior value when I am at the face. Thanks a lot.

--
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 a topic in the Google Groups "deal.II User Group" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/dealii/r6DfmfktQEM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to dealii+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Dr. Sudarshan Kumar Kenettinkara
Post doctoral fellow
Centro de Investigación en Ingeniería Matemática
UDEC, Casilla-160
Concepcion, Chile 4030000
Phone  +56 9 98095323
Office: 20
Phone: +56-4-2661320

Wolfgang Bangerth

unread,
Nov 22, 2016, 8:24:05 AM11/22/16
to dea...@googlegroups.com
On 11/22/2016 06:13 AM, sudarshan kumar wrote:
>
> Thanks a lot, yes it works. In fact I am working on time dependent
> problem, and so in my method I need an adjacent interior value when I am at
> the face. Thanks a lot.

But don't the FEValues objects you get for the face provide these values? I
mean, they evaluate the solution and shape functions on either side of the
face. In other words, while the quadrature points for these two objects have
the same physical locations, they evaluate the elements as the limits of
points coming from each of the cells, and consequently the values are
different even though the points are the same.

Or do you need to evaluate the solution at points inside the cells that are
not in fact on the interface?

Best
W.

--
------------------------------------------------------------------------
Wolfgang Bangerth email: bang...@colostate.edu
www: http://www.math.colostate.edu/~bangerth/

sudarshan kumar

unread,
Nov 22, 2016, 8:40:30 AM11/22/16
to dea...@googlegroups.com

Yes the FEValues defined for each dell dinfo1.cell  and dinfo2.cell  provides  all the interior information of the cells( however  I did not succeed in the accuracy test  so far, but it works ).

In fact,  apart from the interface  values  I need  solution  values  at the interior  of   each cell,  usually  for  time dependent problem this is not really needed ( only the limit value at the face  is required from each side of the face). In my case the method is a bit different, here to compute the interface flux it needs to know few values of the solution in the interior as well.( I am not sure if it is  an efficient way to compute it in the call  integrate_face_term in the meshworker set up).

Thanks  a lot.

--
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 a topic in the Google Groups "deal.II User Group" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/dealii/r6DfmfktQEM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to dealii+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Wolfgang Bangerth

unread,
Nov 22, 2016, 7:35:08 PM11/22/16
to dea...@googlegroups.com
On 11/22/2016 06:40 AM, sudarshan kumar wrote:
>
> In fact, apart from the interface values I need solution values at the
> interior of each cell, usually for time dependent problem this is not
> really needed ( only the limit value at the face is required from each side
> of the face). In my case the method is a bit different, here to compute the
> interface flux it needs to know few values of the solution in the interior as
> well.( I am not sure if it is an efficient way to compute it in the call
> integrate_face_term in the meshworker set up).

I'm not sure whether there is an efficient way for that.

It is uncommon that you would need values from the interior of the cell when
you assemble face terms. It means that you have some kind of non-local
operator, I suppose. MeshWorker was not written for such cases, so it may or
may not be easy to do what you want to do.
Reply all
Reply to author
Forward
0 new messages