// ============================================================================ // == == // == AMDiS - Adaptive multidimensional simulations == // == == // == http://www.amdis-fem.org == // == == // ============================================================================ // // Software License for AMDiS // // Copyright (c) 2010 Dresden University of Technology // All rights reserved. // Authors: Simon Vey, Thomas Witkowski et al. // // This file is part of AMDiS // // See also license.opensource.txt in the distribution. /** \file ElementRegionED.h */ #ifndef AMDIS_ELEMENTREGIONED_H #define AMDIS_ELEMENTREGIONED_H #include "ElementData.h" #include "FixVec.h" #include "Serializer.h" namespace AMDiS { class ElementRegion_ED : public ElementData { public: inline bool isOfType(int typeID) const { if (typeID == ELEMENT_REGION) return true; return false; } class Creator : public CreatorInterface<ElementData> { public: ElementData* create() { return new ElementRegion_ED; } }; ElementRegion_ED(ElementData *decorated = NULL) : ElementData(decorated), region(-1) {} bool refineElementData(Element* parent, Element* child1, Element* child2, int elType) { ElementData::refineElementData(parent, child1, child2, elType); ElementRegion_ED *ep; ep = new ElementRegion_ED(child1->getElementData()); ep->region = region; child1->setElementData(ep); ep = new ElementRegion_ED(child2->getElementData()); ep->region = region; child2->setElementData(ep); return false; } ElementData *clone() const { ElementRegion_ED *newObj = new ElementRegion_ED; newObj->region = region; newObj->decorated = ElementData::clone(); return newObj; } inline std::string getTypeName() const { return "ElementRegion_ED"; } inline const int getTypeID() const { return ELEMENT_REGION; } void serialize(std::ostream& out) { ElementData::serialize(out); SerUtil::serialize(out, region); } void deserialize(std::istream& in) { ElementData::deserialize(in); SerUtil::deserialize(in, region); } inline void setRegion(int r) { region = r; } inline int getRegion() const { return region; } protected: int region; }; } #endif