BELFEM 0.9.0
Berkeley Lab Finite Element Framework
Loading...
Searching...
No Matches
cl_Objective.hpp
Go to the documentation of this file.
1/*
2 * BELFEM -- The Berkeley Lab Finite Element Framework
3 * Copyright (c) 2026, The Regents of the University of California,
4 * through Lawrence Berkeley National Laboratory (subject to receipt of any required
5 * approvals from the U.S. Dept. of Energy). All rights reserved.
6 *
7 * Developers: Christian Messe, Gregory Giard
8 *
9 * See the top-level LICENSE file for the complete license and disclaimer.
10 */
11
12#ifndef BELFEM_CL_OBJECTIVE_HPP
13#define BELFEM_CL_OBJECTIVE_HPP
14
15#include "typedefs.hpp"
16#include "cl_Vector.hpp"
17
18namespace belfem
19{
20 namespace opt
21 {
22//------------------------------------------------------------------------------
23
32 {
33 // number of design variables
34 const uint mDimension;
35
36//------------------------------------------------------------------------------
37 public:
38//------------------------------------------------------------------------------
39
40 Objective( const uint aDimension ) :
41 mDimension( aDimension )
42 {};
43
44//------------------------------------------------------------------------------
45
46 virtual ~Objective() = default;
47
48//------------------------------------------------------------------------------
49
61 virtual real
63 const Vector< real > & aX,
64 Vector< real > & aGradient ) = 0;
65
66//------------------------------------------------------------------------------
67
71 inline uint
72 dimension() const
73 {
74 return mDimension;
75 }
76
77//------------------------------------------------------------------------------
78 };
79 }
80}
81#endif //BELFEM_CL_OBJECTIVE_HPP
virtual real compute_objective(const Vector< real > &aX, Vector< real > &aGradient)=0
evaluate the objective at the design point aX.
virtual ~Objective()=default
Objective(const uint aDimension)
Definition cl_Objective.hpp:40
uint dimension() const
return the number of design variables
Definition cl_Objective.hpp:72
Definition cl_Objective.hpp:21
USER GUIDES:
Definition cl_Capacitor.cpp:16
unsigned int uint
Definition typedefs.hpp:30
double real
Definition typedefs.hpp:36