getfem-users
[Top][All Lists]
Advanced

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

[Getfem-users] Adding new elements without library recompilation


From: Roman Putanowicz
Subject: [Getfem-users] Adding new elements without library recompilation
Date: Tue, 13 Jul 2010 02:09:18 +0200
User-agent: Mutt/1.5.13 (2006-08-11)

Dear All, 

I would like to indicate some minor additions to GetFEM API
that would enable adding new elements without library recompilation.

At the moment adding new element definition to the library requires
modification of the structure fem_naming_system in the file getfem_fem.cc
which results in the need of library recompilation.

However this structure is used in GetFEM code via singleton object
(i.e.  dal::singleton<getfem::fem_naming_system>::instance()).

If we add the following declarations to getfem_fem.h :

 struct fem_naming_system : public dal::naming_system<virtual_fem> {
    fem_naming_system();
 };

 typedef dal::naming_system<virtual_fem>::param_list fem_param_list;

 void read_poly(bgeot::base_poly &p, int d, const char *s);

and in getfem_fem.cc leave only definition of fem_naming_system constructor
then we can add new elements on run time, using the mentioned singleton.

What is more (thought I have not tested that) it should be possible this
way to easily introduce custom aliases for standard GetFEM names of 
finite elements.

Exposing internals is not always good idea but in my view in this case
it is worth it. What do you think?

To Yves:  I have included the recent versions of getfem_fem.cc and getfem_fem.h
with the required changes (couple of lines indeed). If you prefer I can send
patches instead.

Regards

Roman
-- 
Roman Putanowicz, PhD  < address@hidden  >
Institute for Computational Civil Engng (L-5)
Dept. of Civil Engng, Cracow Univ. of Technology
www.l5.pk.edu.pl, tel. +48 12 628 2569, fax 2034

Attachment: getfem_fem.cc
Description: Text Data

Attachment: getfem_fem.h
Description: Text Data


reply via email to

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