// ============================================================================ // == == // == AMDiS - Adaptive multidimensional simulations == // == == // ============================================================================ // == == // == crystal growth group == // == == // == Stiftung caesar == // == Ludwig-Erhard-Allee 2 == // == 53175 Bonn == // == germany == // == == // ============================================================================ // == == // == http://www.caesar.de/cg/AMDiS == // == == // ============================================================================ /** \file EmptyElementData.h */ #ifndef AMDIS_EMPTYELEMENTDATA_H #define AMDIS_EMPTYELEMENTDATA_H #include "Element.h" #include "ElementData.h" #include "FixVec.h" namespace AMDiS { const int EMPTY_ED = 6; class EmptyElementData : public ElementData { public: inline bool isOfType(int typeID) const { if (typeID == EMPTY_ED) return true; return false; } class Creator : public CreatorInterface<ElementData> { public: ElementData* create() { return new EmptyElementData; } }; EmptyElementData(ElementData *decorated = NULL) : ElementData(decorated) {} bool refineElementData(Element* parent, Element* child1, Element* child2, int elType) { ElementData::refineElementData(parent, child1, child2, elType); child1->setElementData(new EmptyElementData(child1->getElementData())); child2->setElementData(new EmptyElementData(child2->getElementData())); return false; } ElementData *clone() const { EmptyElementData *newObj = new EmptyElementData; newObj->decorated_ = ElementData::clone(); return newObj; } inline std::string getTypeName() const { return "EmptyElementData"; } inline const int getTypeID() const { return EMPTY_ED; } void serialize(std::ostream& out) { ElementData::serialize(out); } void deserialize(std::istream& in) { ElementData::deserialize(in); } }; } #endif