dolfin team mailing list archive
-
dolfin team
-
Mailing list archive
-
Message #11305
Re: [HG DOLFIN] Change test for cell-based data in VTKFile.
On Mon, Dec 22, 2008 at 1:14 PM, Garth N. Wells <gnw20@xxxxxxxxx> wrote:
>
>
> Martin Sandve Alnæs wrote:
>>
>> On Mon, Dec 22, 2008 at 1:02 PM, Garth N. Wells <gnw20@xxxxxxxxx> wrote:
>>>
>>> Martin Sandve Alnæs wrote:
>>>>
>>>> This check isn't general either.
>>>>
>>> Can you give me an example of when it fails?
>>
>> It will fail for symmetric tensor elements.
>>
>
> Which we don't yet support :).
Which SFC with UFL will support quite soon,
and which our shared interface UFC allows :)
>>>> // Test for cell-based element type
>>>> - const uint tdim = mesh.topology().dim();
>>>> - bool only_cell_dofs = dofmap.needs_mesh_entities(tdim);
>>>> - for (uint i = 0; i < tdim; i++)
>>>> - {
>>>> - if (dofmap.needs_mesh_entities(i))
>>>> - only_cell_dofs = false;
>>>> - }
>>>> - if (only_cell_dofs)
>>>> + if( dofmap.local_dimension() == std::pow(mesh.topology().dim(), rank)
>>>> )
>>>> data_type = "cell";
>>>>
>>>>
>>>> This is the check I suggested to Anders earlier:
>>>>
>>>> const uint tdim = mesh.topology().dim();
>>>> if(dofmap.num_entity_dofs(tdim) == dofmap.local_dimension())
>>>>
>>> What does num_entity_dofs(tdim) return?
>>>
>>> Garth
>>
>> The number of dofs associated with a cell (mesh entity of dimension tdim).
>> dofmap.num_entity_dofs(0) would return the number of dofs associated
>> with the vertices.
>
> OK. That would make the test easy.
>
>>
>>>> Or hasn't FFC implemented UFC 1.1 yet?
>
> FFC hasn't implemented num_entity_dofs(tdim)
>
> Garth
It's more than ten months since UFC 1.1 was
released, it would be nice if FFC implemented it.
Martin
Follow ups
References