MAST3
Multidisciplinary-design Adaptation and Sensitivity Toolkit (MAST)
design_parameter.hpp
Go to the documentation of this file.
1 /*
2 * MAST: Multidisciplinary-design Adaptation and Sensitivity Toolkit
3 * Copyright (C) 2013-2020 Manav Bhatia and MAST authors
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18 */
19 
20 #ifndef __mast_optimization_design_parameter_h__
21 #define __mast_optimization_design_parameter_h__
22 
23 // MAST includes
25 
26 namespace MAST {
27 namespace Optimization {
28 
29 template <typename ScalarType>
30 class DesignParameter: public MAST::Base::ScalarConstant<ScalarType> {
31 
32 public:
33 
34  using scalar_t = ScalarType;
35 
36  DesignParameter(ScalarType v = 0.):
37  MAST::Base::ScalarConstant<ScalarType> (v),
38  _id (-1) {
39 
40  _point.setZero();
41  }
42 
43  virtual ~DesignParameter() { }
44 
45  inline void set_id(uint_t i) { _id = i;}
46 
47  inline uint_t id() const { return _id;}
48 
49  inline void set_point(real_t x,
50  real_t y = 0.,
51  real_t z = 0.) {
52 
53  _point(0) = x;
54  _point(1) = y;
55  _point(2) = z;
56  }
57 
58  inline const Eigen::Matrix<real_t, 3, 1>& point() const { return _point;}
59 
60 private:
61 
62  // ID of the design parameter
64 
66  Eigen::Matrix<real_t, 3, 1> _point;
67 };
68 }
69 }
70 
71 #endif // __mast_optimization_design_parameter_h__
Eigen::Matrix< real_t, 3, 1 > _point
point to which this parameter is attached
unsigned int uint_t
const Eigen::Matrix< real_t, 3, 1 > & point() const
void set_point(real_t x, real_t y=0., real_t z=0.)
double real_t
ScalarConstant(ScalarType v=0.)