ControlDeformMaxDistance.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 __CONTROLDEFORMMAXDISTANCE_HPP__
25 #define __CONTROLDEFORMMAXDISTANCE_HPP__
26 
27 #include "BaseManipulation.hpp"
28 
29 namespace mimmo{
30 
85 private:
86  double m_maxDist;
87  dmpvector1D m_violationField;
88  dmpvecarr3E m_defField;
90 public:
92  ControlDeformMaxDistance(const bitpit::Config::Section & rootXML);
94 
97 
98  void buildPorts();
99 
100  double getViolation();
102 
103  void setDefField(dmpvecarr3E *field);
104  void setLimitDistance(double dist);
106 
107  void execute();
108 
109  virtual void absorbSectionXML(const bitpit::Config::Section & slotXML, std::string name = "");
110  virtual void flushSectionXML(bitpit::Config::Section & slotXML, std::string name= "");
111 
112 protected:
113  void plotOptionalResults();
114  void swap(ControlDeformMaxDistance & x) noexcept;
115 };
116 
117 REGISTER_PORT(M_GDISPLS, MC_SCALAR, MD_MPVECARR3FLOAT_,__CONTROLDEFORMMAXDISTANCE_HPP__)
118 REGISTER_PORT(M_VALUED, MC_SCALAR, MD_FLOAT,__CONTROLDEFORMMAXDISTANCE_HPP__)
119 REGISTER_PORT(M_GEOM, MC_SCALAR, MD_MIMMO_,__CONTROLDEFORMMAXDISTANCE_HPP__)
120 REGISTER_PORT(M_SCALARFIELD, MC_SCALAR, MD_MPVECFLOAT_,__CONTROLDEFORMMAXDISTANCE_HPP__)
121 
122 
123 REGISTER(BaseManipulation, ControlDeformMaxDistance, "mimmo.ControlDeformMaxDistance")
124 }
125 
126 #endif /* __CONTROLDEFORMMAXDISTANCE_HPP__ */
#define M_GDISPLS
virtual void absorbSectionXML(const bitpit::Config::Section &slotXML, std::string name="")
#define M_GEOM
void swap(ControlDeformMaxDistance &x) noexcept
#define MD_FLOAT
ControlDeformMaxDistance & operator=(ControlDeformMaxDistance other)
BaseManipulation is the base class of any manipulation object of the library.
void setGeometry(MimmoSharedPointer< MimmoObject > geo)
#define MC_SCALAR
#define MD_MPVECARR3FLOAT_
ControlDeformMaxDistance is a class that check a deformation field associated to a MimmoObject surfac...
#define REGISTER_PORT(Name, Container, Datatype, ManipBlock)
#define M_VALUED
#define MD_MIMMO_
virtual void flushSectionXML(bitpit::Config::Section &slotXML, std::string name="")
#define MD_MPVECFLOAT_
#define M_SCALARFIELD
MimmoSharedPointer is a custom implementation of shared pointer.
#define REGISTER(Base, Derived, name)
Definition: factory.hpp:206