Attempting to answer my own question, I tried the following which seems to
work. Note that this code is inside the face integration function which has
two DoFInfo objects for the two cells sharing the face.
Is this the correct/best way to do it ?
Thanks
praveen
// Add shock indicator to the two cells
DoFAccessor<dim,DoFHandler<dim> > dof_accessor1 (&triangulation,
dinfo1.cell->level(),
dinfo1.cell->index(),
&dh_cell);
DoFAccessor<dim,DoFHandler<dim> > dof_accessor2 (&triangulation,
dinfo2.cell->level(),
dinfo2.cell->index(),
&dh_cell);
shock_indicator(dof_accessor1.dof_index(0)) += jump.val();
shock_indicator(dof_accessor2.dof_index(0)) += jump.val();
On Mon, Apr 4, 2011 at 11:42 AM, Praveen C <[email protected]> wrote:
> Hello all,
>
> I am still trying to find a good solution to this problem.
>
> I now do the following:
>
> const dealii::FE_DGQ<dim> fe_cell;
> dealii::DoFHandler<dim> dh_cell;
>
> fe_cell is of degree zero, dh_cell is the corresponding dof handler; I
> have one dof per cell.
>
> I want to compute a shock indicator on each cell:
>
> dealii::Vector<double> shock_indicator;
>
> Using MeshWorker, when I am in the face integration function, I calculate a
> jump term for the face. I now want to add the jump term to the
> shock_indicator variable on the two cells sharing the face.
>
> My problem is how to get the dof indices for fe_cell on the current cell,
> inside the integrate face/boundary functions.
>
> Note that the MeshWorker is based on a different fe, not on fe_cell.
>
> Thanks
> praveen
>
>
> On Sun, Mar 27, 2011 at 5:54 PM, Wolfgang Bangerth <[email protected]
> > wrote:
>
>>
>> > yes, every cell has a index. You can access it by cell->index ().
>>
>> But this only gives the index of the cell *within the current mesh level*
>> and
>> the set of indices may also have holes.
>>
>> Best
>> W.
>>
>>
_______________________________________________
dealii mailing list http://poisson.dealii.org/mailman/listinfo/dealii