octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[fem-fenics] Template meshfunction


From: Eugenio Gianniti
Subject: [fem-fenics] Template meshfunction
Date: Wed, 6 Aug 2014 20:01:18 +0000


A second aspect is that meshfunction is actually very, very raw. Currently there is no way to display it, no function to build it as users need… Moreover, its name is quite misleading, as dolfin::MeshFunction is a template class, whilst meshfunction wraps dolfin::MeshFunction <std::size_t>. For the first issues I think I can provide easily functionality as importing/exporting a MeshFunction from/to file, a descriptive line to display like in other fem-fenics types, etc. For the latter, I do not know if it could be meaningful to make meshfunction itself a template class or just provide three wrappers for <std::size_t>, <bool> and <double>, which are the most recurring instances in FEniCS documentation. Or even just leave it as it is and say it in the package documentation.

I think that the solution with the meshfunction as a template is better but I don't know how hard it could be to achieve. As we are entering the last week before the "suggested" pencil down deadline ( 11th of August), a good idea could be to give a try to the template solution for the first few days of the next week. If we realize that it is too difficult, we could switch to the solution with the multiple wrappers, which should be quite easy to do as it is similar to many other you have already done.

I have just pushed a commit allowing for importing a new wrapper of an instance of the dolfin::MeshFunction template class. Basically it writes the same code as in meshfunction.h, MeshFunction.cc and save_mf.cc to meshfunction_typename.h, etc, then it compiles it. Obviously, instead of std::size_t there will be the type asked by the user with a call to import_meshfunction_type.

There is still a bit of work to do. I have just remembered that in C++ there are type identifiers with “structural whitespace” (I am not going nuts, what I mean is that “unsigned long” names a type, “unsignedlong” does not), so I need to make a couple of corrections to the functions writing code. I should also check whether angle brackets are allowed in an identifier, which I doubt. Anyway, I am looking forward to hearing advice on how to verify the functionality of these edits and comments on them.

Eugenio


Marco
 
Eugenio



reply via email to

[Prev in Thread] Current Thread [Next in Thread]