![]() |
00001 // Copyright (C) 2003 Johan Hoffman and Anders Logg. 00002 // Licensed under the GNU GPL Version 2. 00003 00004 #ifndef __COMPONENT_H 00005 #define __COMPONENT_H 00006 00007 #include <functional> 00008 #include <vector> 00009 #include <dolfin/constants.h> 00010 #include <dolfin/NewArray.h> 00011 #include <dolfin/Element.h> 00012 00013 namespace dolfin { 00014 00015 class Element; 00016 class TimeSlab; 00017 class RHS; 00018 00019 class Component { 00020 public: 00021 00023 Component(); 00024 00026 ~Component(); 00027 00029 Element* createElement(Element::Type type, unsigned int q, unsigned int index, 00030 real t0, real t1); 00031 00033 Element* element(real t); 00034 00036 Element* first(); 00037 00039 Element* last(); 00040 00042 unsigned int size() const; 00043 00044 friend class ElementTmpFile; 00045 00046 private: 00047 00048 // Find element for given time 00049 Element* findpos(real t); 00050 00051 // Comparison operator for location of element 00052 struct Less : public std::binary_function<Element*, Element* , bool> 00053 { 00054 Less(Element *dummy, real t); 00055 bool operator()(const Element *x, const Element *y); 00056 00057 Element *dummy; 00058 real t; 00059 }; 00060 00061 //--- Component data --- 00062 00063 // A list of elements for this component 00064 NewArray<Element*> elements; 00065 00066 // Cache last element 00067 Element* cacheElement; 00068 00069 }; 00070 00071 } 00072 00073 #endif
Documentation automatically generated with Doxygen on 10 Sep 2004.