GetFEM++  5.3
getfem::context_dependencies Class Referenceabstract

Deal with interdependencies of objects. More...

#include <getfem_context.h>

Inherited by getfem::fem_global_function, getfem::global_function_on_levelsets_2D_, getfem::im_data, getfem::interpolate_transformation_element_extrapolation, getfem::interpolate_transformation_expression, getfem::interpolate_transformation_neighbour, getfem::interpolated_fem, getfem::level_set, getfem::mesh, getfem::mesh_fem, getfem::mesh_im, getfem::mesh_level_set, getfem::mf__key_, getfem::model, and getfem::projected_fem.

Public Member Functions

virtual void update_from_context () const =0
 this function has to be defined and should update the object when the context is modified. More...
bool context_check () const
 return true if update_from_context was called

Detailed Description

Deal with interdependencies of objects.

An object can be in three different states : NORMAL : no change is necessary CHANGED : something in the context has changed and the update function of the object has to be called. INVALID : one of the dependencies desappears, the object is invalid and should no longer be used.

add_dependency(ct) : add a dependency to the dependency list.

touch() : significate to the dependent objects that something has change in the object. This make the dependent objects to be in the CHANGED state

context_check() : 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).

context_valid() : says if the object has still a valid context

Remarks :

  • A protection against round dependencies exists. In this case, the order of call of the update functions can be arbitrary
  • Detection of context changes is very fast (control the state). the touch operation can cover the whole tree of dependent object. But this is the case only for the first touch operation because once a dependent object is in the CHANGED state it will not be considered by next touch operations.

Definition at line 87 of file getfem_context.h.

Member Function Documentation

virtual void getfem::context_dependencies::update_from_context ( ) const
pure virtual

The documentation for this class was generated from the following files: