1 /*  _______________________________________________________________________
2 
3     DAKOTA: Design Analysis Kit for Optimization and Terascale Applications
4     Copyright 2014-2020 National Technology & Engineering Solutions of Sandia, LLC (NTESS).
5     This software is distributed under the GNU Lesser General Public License.
6     For more information, see the README file in the top Dakota directory.
7     _______________________________________________________________________ */
8 
9 //- Class:        SimulationResponse
10 //- Description:  Container class for response functions and their derivatives.
11 //-
12 //- Owner:        Mike Eldred
13 //- Version: $Id: SimulationResponse.hpp 7024 2010-10-16 01:24:42Z mseldre $
14 
15 #ifndef SIMULATION_RESPONSE_H
16 #define SIMULATION_RESPONSE_H
17 
18 #include "dakota_system_defs.hpp"
19 #include "dakota_data_types.hpp"
20 #include "DakotaResponse.hpp"
21 
22 namespace Dakota {
23 
24 class ProblemDescDB;
25 
26 
27 /// Container class for response functions and their derivatives.
28 /// SimulationResponse provides the body class.
29 
30 /** The SimulationResponse class is the "representation" of the
31     response container class.  It is the "body" portion of the
32     "handle-body idiom" (see Coplien "Advanced C++", p. 58).  The
33     handle class (Response) provides for memory efficiency in
34     management of multiple response objects through reference counting
35     and representation sharing.  The body class (SimulationResponse)
36     actually contains the response data (functionValues,
37     functionGradients, functionHessians, etc.).  The representation is
38     hidden in that an instance of SimulationResponse may only be
39     created by Response.  Therefore, programmers create
40     instances of the Response handle class, and only need to be
41     aware of the handle/body mechanisms when it comes to managing
42     shallow copies (shared representation) versus deep copies
43     (separate representation used for history mechanisms). */
44 
45 class SimulationResponse: public Response
46 {
47 public:
48 
49   //
50   //- Heading: Constructors and destructor
51   //
52 
53   /// default constructor
54   SimulationResponse();
55   /// standard constructor built from problem description database
56   SimulationResponse(const Variables& vars, const ProblemDescDB& problem_db);
57   /// alternate constructor that shares a SharedResponseData instance
58   SimulationResponse(const SharedResponseData& srd, const ActiveSet& set);
59   /// alternate constructor that shares a SharedResponseData instance
60   SimulationResponse(const SharedResponseData& srd);
61   /// alternate constructor using limited data
62   SimulationResponse(const ActiveSet& set);
63   /// destructor
64   ~SimulationResponse();
65 
66 protected:
67 
68   //
69   //- Heading: member functions
70   //
71 
72 private:
73 
74   //
75   //- Heading: Private data members
76   //
77 
78 };
79 
80 
SimulationResponse()81 inline SimulationResponse::SimulationResponse()
82 { }
83 
84 
~SimulationResponse()85 inline SimulationResponse::~SimulationResponse()
86 { }
87 
88 } // namespace Dakota
89 
90 
91 // Since we may serialize this class through a temporary, force
92 // serialization mode and no tracking
93 BOOST_CLASS_IMPLEMENTATION(Dakota::SimulationResponse,
94 			   boost::serialization::object_serializable)
95 BOOST_CLASS_TRACKING(Dakota::SimulationResponse,
96 		     boost::serialization::track_never)
97 
98 #endif // !SIMULATION_RESPONSE_H
99