Primitive.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 __PRIMITIVE_HPP__
25 #define __PRIMITIVE_HPP__
26 
27 #include "BaseManipulation.hpp"
28 #include "BasicShapes.hpp"
29 #include "BasicMeshes.hpp"
30 
31 namespace mimmo{
32 
92 class Primitive: public BaseManipulation, public UStructMesh {
93 
94 public:
95  Primitive();
96  Primitive(const bitpit::Config::Section & rootXML);
97  virtual ~Primitive();
98 
99  //copy operators/constructors
100  Primitive(const Primitive & other);
101 
102  void buildPorts();
103  void clearPrimitive();
104 
105  void execute();
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 
111 protected:
112  void swap(Primitive & ) noexcept;
113 
114 
115 private:
116  darray3E getSpacing() = delete;
117  iarray3E getDimension() = delete;
118  darray3E getLocalCCell(int) = delete;
119  darray3E getLocalCCell(int, int, int) = delete;
120  darray3E getLocalPoint(int) = delete;
121  darray3E getLocalPoint(int, int, int) = delete;
122  darray3E getGlobalCCell(int) = delete;
123  darray3E getGlobalCCell(int, int, int) = delete;
124  darray3E getGlobalPoint(int) = delete;
125  darray3E getGlobalPoint(int, int, int) = delete;
126  ivector1D getCellNeighs(int) = delete;
127  ivector1D getCellNeighs(int, int, int) = delete;
128  dvecarr3E getLocalCoords() = delete;
129  dvecarr3E getGlobalCoords() = delete;
130  dvecarr3E getGlobalCellCentroids() = delete;
131  dvecarr3E getLocalCellCentroids() = delete;
132  void setDimension(ivector1D dim) = delete;
133  void setDimension(iarray3E dim) = delete;
134  void locateCellByPoint(darray3E & point, int &i, int &j, int &k) = delete;
135  void locateCellByPoint(dvector1D & point, int &i, int &j, int &k) = delete;
136  int accessCellIndex(int i, int j, int k) = delete;
137  void accessCellIndex(int N_, int &i, int &j, int &k) = delete;
138  int accessPointIndex(int i, int j, int k) = delete;
139  void accessPointIndex(int N_, int &i, int &j, int &k) = delete;
140  double interpolateCellData(darray3E & point, dvector1D & celldata) = delete;
141  int interpolateCellData(darray3E & point, ivector1D & celldata) = delete;
142  darray3E interpolateCellData(darray3E & point, dvecarr3E & celldata) = delete;
143  double interpolatePointData(darray3E & point, dvector1D & pointdata) = delete;
144  int interpolatePointData(darray3E & point, ivector1D & pointdata) = delete;
145  darray3E interpolatePointData(darray3E & point, dvecarr3E & pointdata) = delete;
146  void plotCloud( std::string & , std::string, int , bool, const ivector1D & labels, dvecarr3E * extPoints=nullptr) = delete;
147  void plotCloudScalar(std::string, std::string , int, bool, dvector1D & data) = delete;
148  void plotGrid(std::string &, std::string , int, bool, const ivector1D & labels, dvecarr3E * extPoints=nullptr) = delete;
149  void plotGridScalar(std::string, std::string , int, bool, dvector1D & data) = delete;
150  bool isBuilt() = delete;
151  void resizeMesh() = delete;
152  void destroyNodalStructure() = delete;
153  void reshapeNodalStructure() = delete;
154 
155 
156 };
157 
158 REGISTER_PORT(M_DIMENSION, MC_ARRAY3, MD_INT, __PRIMITIVE_HPP__)
159 REGISTER_PORT(M_INFLIMITS, MC_ARRAY3, MD_FLOAT, __PRIMITIVE_HPP__)
160 REGISTER_PORT(M_AXES, MC_ARR3ARR3, MD_FLOAT, __PRIMITIVE_HPP__)
161 REGISTER_PORT(M_SPAN, MC_ARRAY3, MD_FLOAT, __PRIMITIVE_HPP__)
162 REGISTER_PORT(M_POINT, MC_ARRAY3, MD_FLOAT, __PRIMITIVE_HPP__)
163 REGISTER_PORT(M_SHAPE, MC_SCALAR, MD_SHAPET, __PRIMITIVE_HPP__)
164 REGISTER_PORT(M_COPYSHAPE, MC_SCALAR, MD_SHAPE_, __PRIMITIVE_HPP__)
165 REGISTER_PORT(M_SHAPEI, MC_SCALAR, MD_INT, __PRIMITIVE_HPP__)
166 
167 REGISTER(BaseManipulation, Primitive, "mimmo.Primitive")
168 
169 }
170 
171 #endif /* __PRIMITIVE_HPP__ */
void clearPrimitive()
Definition: Primitive.cpp:94
std::array< int, 3 > iarray3E
#define MC_ARRAY3
#define MD_FLOAT
std::vector< darray3E > dvecarr3E
#define MC_ARR3ARR3
#define M_POINT
#define M_DIMENSION
virtual ~Primitive()
Definition: Primitive.cpp:53
BaseManipulation is the base class of any manipulation object of the library.
#define M_SHAPE
#define M_SHAPEI
#define M_INFLIMITS
#define MC_SCALAR
std::vector< int > ivector1D
#define REGISTER_PORT(Name, Container, Datatype, ManipBlock)
#define MD_SHAPE_
#define MD_SHAPET
std::vector< double > dvector1D
#define M_SPAN
#define M_AXES
virtual void absorbSectionXML(const bitpit::Config::Section &slotXML, std::string name="")
Definition: Primitive.cpp:111
Class for 3D uniform structured mesh.
Definition: BasicMeshes.hpp:44
virtual void flushSectionXML(bitpit::Config::Section &slotXML, std::string name="")
Definition: Primitive.cpp:192
#define M_COPYSHAPE
std::array< double, 3 > darray3E
#define MD_INT
void swap(Primitive &) noexcept
Definition: Primitive.cpp:65
Primitive object generation.
Definition: Primitive.hpp:92
#define REGISTER(Base, Derived, name)
Definition: factory.hpp:206