> On 02-Jun-2021, at 8:44 PM, Wolfgang Bangerth <[email protected]> wrote:
>
> For DG, it probably wouldn't be very difficult to implement something like
> this, but it doesn't exist at the moment.
>
> Can I ask why you want this particular property? Why is it not enough to have
> all DoFs associated with a cell contiguous in memory? And why do you care
> about the cell-local order of DoFs, and not the global DoF indices?
I do want all dofs in a cell to be contiguous in memory. But I want bit more.
In a setup like this, say in dim=2
FESystem( FE_DGQArbitraryNodes(QGauss<1>(degree+1)), nvar)
Vector<double> solution
on each cell I want to extract the solution into a local variable
double cell_solution[degree+1][degree+1][nvar]
So I want all nvar-values at each support point to be contiguous in memory.
I can achieve this by doing a DoF renumbering. Suppose I have done this.
Now when I extract
cell->get_dof_indices( local_dof_indices );
index = 0;
for(j = 0; j < degree+1; ++j)
for(i = 0; i < degree+1; ++i)
for(c = 0; c < nvar; ++c)
{
cell_solution[j][i][c] = solution( local_dof_indices[index] );
++index;
}
The access into solution is not contiguous, it jumps around. This is because of
how FESystem orders dofs within a cell.
To access solution contiguously, I can do this
cell->get_dof_indices( local_dof_indices );
for(j = 0; j < degree+1; ++j)
for(i = 0; i < degree+1; ++i)
for(c = 0; c < nvar; ++c)
{
c_index = i + (degree+1)*j;
index = fe.component_to_system_index(c, c_index);
cell_solution[j][i][c] = solution( local_dof_indices[index] );
}
but my access into local_dof_indices is not contiguous.
In a DG case, I should be able to do the following, without needing
local_dof_indices, and still access all memory contiguously
cell->get_dof_indices( local_dof_indices );
index = local_dof_indices[0]; // get first index on this cell
for(j = 0; j < degree+1; ++j)
for(i = 0; i < degree+1; ++i)
for(c = 0; c < nvar; ++c)
{
cell_solution[j][i][c] = solution( index );
++index;
}
There is no need for the whole local_dof_indices, if I know the starting index
on cell, it is enough.
This would be useful for writing tensor product DG codes, which is needed for
things like Euler/compressible NS problems.
Thanks
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/dealii/EF206BC7-53E3-4CB5-AF2B-72B43D246C7C%40gmail.com.