On 24/02/11 19:20, Anders Logg wrote: > On Thu, Feb 24, 2011 at 04:23:36PM +0000, Garth N. Wells wrote: >> We've just added 'create' functions to UFC, but it would also be useful >> to add 'copy' functions. It'd like to get a copy a ufc::dofmap, but I >> can't do it at present. 'create' doesn't work since I don't have the >> mesh available in order to initialise the ufc::dofmap that it returned >> by 'create'. > > Implementing copy might be problematic for form compilers since it > would involve copying data that may have been generated as part of the > call to init_mesh and init_cell. It's no big deal in the case of FFC > since only _global_dimension needs to be copied, but it might be > problematic in general. The more functions we add to the interface, > the more work it is to implement the UFC interface. > > It would be better to store the Mesh as part of the DofMap so that a > copy can be created using the create function. >
I'm reluctant to add the Mesh to DofMap, since unless we store a copy of the Mesh the Mesh could change which would make it inconsistent with the dof map. Also, I've tried to simplify DofMap and minimise the private data because it can get pretty complex with views, parallel ownership, etc. For now I've added GenericDofMap::copy(const Mesh& mesh), which is ok. Internally, DofMap creates some UFCMesh objects which could be avoided if ufc::dofmaps could be copied. Garth > -- > Anders _______________________________________________ Mailing list: https://launchpad.net/~fenics Post to : [email protected] Unsubscribe : https://launchpad.net/~fenics More help : https://help.launchpad.net/ListHelp

