StitchGeometry.hpp
1 /*---------------------------------------------------------------------------*\
2  *
3  * mimmo
4  *
5  * Copyright (C) 2015-2021 OPTIMAD engineering Srl
6  *
7  * -------------------------------------------------------------------------
8  * License
9  * This file is part of mimmo.
10  *
11  * mimmo is free software: you can redistribute it and/or modify it
12  * under the terms of the GNU Lesser General Public License v3 (LGPL)
13  * as published by the Free Software Foundation.
14  *
15  * mimmo is distributed in the hope that it will be useful, but WITHOUT
16  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
17  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
18  * License for more details.
19  *
20  * You should have received a copy of the GNU Lesser General Public License
21  * along with mimmo. If not, see <http://www.gnu.org/licenses/>.
22  *
23 \*---------------------------------------------------------------------------*/
24 #ifndef __STITCHGEOMETRY_HPP__
25 #define __STITCHGEOMETRY_HPP__
26 
27 #include "BaseManipulation.hpp"
28 
29 namespace mimmo{
30 
73 
74 private:
75  int m_topo;
76  std::unordered_map<mimmo::MimmoSharedPointer<MimmoObject>,int> m_extgeo;
80  std::unordered_map<long, std::pair<int, long> > m_mapCellDivision;
81  std::unordered_map<long, std::pair<int, long> > m_mapVertDivision;
83  int m_geocount;
84  bool m_repid;
86 public:
87  StitchGeometry(int topo);
88  StitchGeometry(const bitpit::Config::Section & rootXML);
89  virtual ~StitchGeometry();
90 
91  StitchGeometry(const StitchGeometry & other);
93 
94  void buildPorts();
95 
96  int getTopology();
98 
100 
101  bool isEmpty();
102 
103  void clear();
104  void execute();
105  void forceRePID(bool flag);
106 
107  virtual void absorbSectionXML(const bitpit::Config::Section & slotXML, std::string name="");
108  virtual void flushSectionXML(bitpit::Config::Section & slotXML, std::string name="");
109 
110  void plotOptionalResults();
111 protected:
112  void swap(StitchGeometry & x) noexcept;
113 };
114 
115 REGISTER_PORT(M_GEOM, MC_SCALAR, MD_MIMMO_, __STITCHGEOMETRY_HPP__)
116 
117 
118 REGISTER(BaseManipulation, StitchGeometry, "mimmo.StitchGeometry")
119 
120 };
121 
122 #endif /* __STITCHGEOMETRY_HPP__ */
#define M_GEOM
void forceRePID(bool flag)
mimmo::MimmoSharedPointer< MimmoObject > getGeometry()
BaseManipulation is the base class of any manipulation object of the library.
StitchGeometry & operator=(StitchGeometry other)
#define MC_SCALAR
#define REGISTER_PORT(Name, Container, Datatype, ManipBlock)
void addGeometry(mimmo::MimmoSharedPointer< MimmoObject > geo)
virtual void absorbSectionXML(const bitpit::Config::Section &slotXML, std::string name="")
StitchGeometry is an executable block class capable of stitch multiple MimmoObject geometries of the ...
#define MD_MIMMO_
void swap(StitchGeometry &x) noexcept
MimmoSharedPointer is a custom implementation of shared pointer.
#define REGISTER(Base, Derived, name)
Definition: factory.hpp:206
virtual void flushSectionXML(bitpit::Config::Section &slotXML, std::string name="")