The mesh, mesh_fem, mesh_im and model description are linkedtogether in the sense that there is some dependencies between them. For instance, when an element is suppressed to a mesh, the mesh_fem object has to react.
File(s) | Description |
---|---|
getfem_context.h and getfem_context.cc | Define a class context_dependencies from which all object has to derive in order to manage events. |
The main tool to deal with simple dependence of object is in getfem_context.h. An object context_dependencies is defined there. In order to deal with the dependencies of an object, the object context_dependencies needs to be a parent class of this object. It adds the following methods to the object:
Add an object (which has to have context_dependencies as a parent class) to the list of objects from which the current object depend.
Indicates to the dependent objects that something has change in the object.
Check if the object has to be updated. if it is the case it makes first a check to the dependency list and call the update function of the object. (the update function of the dependencies are called before the update function of the current object).
Says if the object has still a valid context, i.e. if the object in the dependency list still exist.
Moreover, the object has to define a method:
``void update_from_context(void) const``
which is called after a context_check() if the context has changed.
An additional system is present in the object mesh. Each individual element has a version number in order for the objects mesh_fem and mesh_im to detect which element has changed between two calls.
The event management of some objects should be analysed with care This is the case for instance of|mls|, mesh_fem_level_set, partial_mesh_fem, etc.
The event management still have to be improved to be a fully reactive system.