← Back to team overview

dolfin team mailing list archive

Re: [HG DOLFIN] Remove debug output.

 

On Thu, May 14, 2009 at 10:51 AM, Anders Logg <logg@xxxxxxxxx> wrote:
> On Thu, May 14, 2009 at 09:15:08AM +0100, Garth N. Wells wrote:
>>
>>
>> Ola Skavhaug wrote:
>> > On Thu, May 14, 2009 at 9:36 AM, Garth N. Wells <gnw20@xxxxxxxxx> wrote:
>> >> Something in the recent change sets has broken some demos, for example
>> >>
>> >>     demo/pde/advection-diffusion/cpp
>> >>
>> >> Garth
>> >
>> > OK, I think I know what's breaking it. The dofmap gets the wrong
>> > global dimension, and we are changing some of the logic there. I will
>> > need to dig a little deeper.

For the moment, if you just call mesh.init(1) in the demo, things work
again. When we make new dolfin wrapper code from FFC/UFL (adding the
non const Mesh FunctionSpace constructors), we can revert the demos
back.

Ola

>> >
>>
>> The problem is that the code
>>
>>    // Initialize mesh entities used by dof map
>>    for (uint d = 0; d <= mesh.topology().dim(); d++)
>>      if (ufc_dof_map->needs_mesh_entities(d))
>>      {
>>        mesh.init(d);
>>        if (d > 0 && parallel)
>>          MeshPartitioning::number_entities(const_cast<Mesh&>(mesh), d);
>>      }
>>
>> inside DofMap::init(const Mesh& mesh) has been commented out. Mesh
>> entities which are required for the dof map are not being initialised.
>>
>> Can this code just be 'turned' back on?
>
> The plan is for this to happen in the constructor of FunctionSpace
> instead. There are now two different constructors, one const and one
> non-const.
>
> The non-const version should check which entities are needed and if they
> are not there compute them. This means calling mesh.init(d) and if
> running in parallel also number_entities which computes global indices
> for all entities. The global indices are stored in MeshData with keys
> "global entity indices 0", "global entity indices 1" etc.
>
> The const version should check which entities are needed and if they
> are not there give an error message.
>
> This will require modifying the generated DOLFIN wrapper code (in
> dolfin_utils) to generate both constructors.
>
> When this works, we can remove the const-casts for init() in Mesh.
>
> It's more honest if we make the const really mean const.
>
> --
> Anders
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.9 (GNU/Linux)
>
> iEYEARECAAYFAkoL24EACgkQTuwUCDsYZdH8gQCffNLKXnioiSFCOhQo0T6KMk6t
> EKgAn1GMNA+N+ygVHbh6wTTBTEyj+pxM
> =C/Qx
> -----END PGP SIGNATURE-----
>
> _______________________________________________
> DOLFIN-dev mailing list
> DOLFIN-dev@xxxxxxxxxx
> http://www.fenics.org/mailman/listinfo/dolfin-dev
>
>



-- 
Ola Skavhaug


References