ScaleGeometry.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 __SCALEGEOMETRY_HPP__
25 #define __SCALEGEOMETRY_HPP__
26 
27 #include "BaseManipulation.hpp"
28 
29 namespace mimmo{
30 
79 private:
80  darray3E m_origin;
81  darray3E m_scaling;
82  dmpvector1D m_filter;
83  dmpvecarr3E m_displ;
84  bool m_meanP;
86 public:
87  ScaleGeometry(darray3E scaling = { {1.0, 1.0, 1.0} });
88  ScaleGeometry(const bitpit::Config::Section & rootXML);
90 
91  ScaleGeometry(const ScaleGeometry & other);
93 
94  void buildPorts();
95 
96  void setScaling(darray3E scaling);
97  void setFilter(dmpvector1D *filter);
98  void setOrigin(darray3E origin);
99  void setMeanPoint(bool meanP);
100 
102 
103  void execute();
104  void apply();
105 
106  virtual void absorbSectionXML(const bitpit::Config::Section & slotXML, std::string name = "");
107  virtual void flushSectionXML(bitpit::Config::Section & slotXML, std::string name= "");
108 
109 protected:
110  void swap(ScaleGeometry & x) noexcept;
111  void checkFilter();
112 
113 };
114 
115 REGISTER_PORT(M_POINT, MC_ARRAY3, MD_FLOAT,__SCALEGEOMETRY_HPP__)
116 REGISTER_PORT(M_SPAN, MC_ARRAY3, MD_FLOAT,__SCALEGEOMETRY_HPP__)
117 REGISTER_PORT(M_FILTER, MC_SCALAR, MD_MPVECFLOAT_,__SCALEGEOMETRY_HPP__)
118 REGISTER_PORT(M_GEOM, MC_SCALAR, MD_MIMMO_,__SCALEGEOMETRY_HPP__)
119 REGISTER_PORT(M_GDISPLS, MC_SCALAR, MD_MPVECARR3FLOAT_,__SCALEGEOMETRY_HPP__)
120 
121 
122 REGISTER(BaseManipulation, ScaleGeometry, "mimmo.ScaleGeometry")
123 
124 };
125 
126 #endif /* __SCALEGEOMETRY_HPP__ */
dmpvecarr3E * getDisplacements()
#define M_GDISPLS
ScaleGeometry is the class that applies a scaling to a given geometry patch in respect to the mean po...
void setFilter(dmpvector1D *filter)
virtual void flushSectionXML(bitpit::Config::Section &slotXML, std::string name="")
#define M_GEOM
#define MC_ARRAY3
#define MD_FLOAT
void swap(ScaleGeometry &x) noexcept
#define M_POINT
BaseManipulation is the base class of any manipulation object of the library.
virtual void absorbSectionXML(const bitpit::Config::Section &slotXML, std::string name="")
ScaleGeometry & operator=(ScaleGeometry other)
#define MC_SCALAR
#define MD_MPVECARR3FLOAT_
#define REGISTER_PORT(Name, Container, Datatype, ManipBlock)
#define M_SPAN
#define MD_MIMMO_
#define MD_MPVECFLOAT_
ScaleGeometry(darray3E scaling={ {1.0, 1.0, 1.0} })
std::array< double, 3 > darray3E
void setMeanPoint(bool meanP)
void setOrigin(darray3E origin)
void setScaling(darray3E scaling)
#define M_FILTER
#define REGISTER(Base, Derived, name)
Definition: factory.hpp:206