// ============================================================================ // == == // == AMDiS - Adaptive multidimensional simulations == // == == // ============================================================================ // == == // == TU Dresden == // == == // == Institut für Wissenschaftliches Rechnen == // == Zellescher Weg 12-14 == // == 01069 Dresden == // == germany == // == == // ============================================================================ // == == // == https://gforge.zih.tu-dresden.de/projects/amdis/ == // == == // ============================================================================ /** \file InteriorBoundary.h */ #ifndef AMDIS_INTERIORBOUNDARY_H #define AMDIS_INTERIORBOUNDARY_H #include #include #include "MacroElement.h" #include "AMDiS_fwd.h" namespace AMDiS { /// Defines the geometrical objects that forms the boundary; struct BoundaryObject { BoundaryObject() : reverseMode(false) {} /// The macro element to which the boundary element corresponds to. Element* el; /// Index of the macro element. int elIndex; /// Element type index, only used in 3d. int elType; /** \brief * Defines the geometrical object at the boundary. It must be "a part" of the * macro element \ref el, i.e., either 1 (a vertex), 2 (an edge) or 3 (a face). */ GeoIndex subObj; /** \brief * Defines which of vertix, edge or face of the macro element is part of the * boundary. * * Example: If the macro element is a triangle, than \ref subObj may be either * 1 (vertex) or 2 (edge). Assume its the last one. So this variable defines * which of the three possible edges of the triangle is at the interior * boundary. */ int ithObj; bool reverseMode; void setReverseMode(BoundaryObject &otherBound, FiniteElemSpace *feSpace); }; /** \brief * Defines one atomic part of the boundary, i.e., two boundary objects where the * boundary goes through. */ struct AtomicBoundary { /// The rank's part of the boundary. BoundaryObject rankObj; /// The object on the other side of the boundary. BoundaryObject neighObj; }; /** \brief * Defines the interior boundary, i.e. a bound within the domain. It is used for * the classical domain decomposition parallelization. */ class InteriorBoundary { public: typedef std::map > RankToBoundMap; public: InteriorBoundary() {} AtomicBoundary& getNewAtomic(int rank); /// Writes this object to a file. void serialize(std::ostream &out); /// Reads the state of an interior boundary from a file. void deserialize(std::istream &in, std::map &elIndexMap); public: RankToBoundMap boundary; }; } #endif // AMDIS_INTERIORBOUNDARY_H