G+Smo  25.01.0
Geometry + Simulation Modules
 
Loading...
Searching...
No Matches
gsOptProblemStatic< T > Class Template Reference

Detailed Description

template<typename T>
class gismo::gsOptProblemStatic< T >

A class representing a static optimization problem.

Template Parameters
TThe coefficient type.

This class inherits from gsOptProblem and provides functionality for evaluating the objective function and its gradient for static optimization problems.

+ Inheritance diagram for gsOptProblemStatic< T >:
+ Collaboration diagram for gsOptProblemStatic< T >:

Public Member Functions

virtual void computeJacStructure ()
 Computes the sparsity pattern of the constraint Jacobian matrix.
 
virtual void evalCon_into (const gsAsConstVector< T > &, gsAsVector< T > &) const
 Returns values of the constraints at design value u.
 
evalObj (const gsAsConstVector< T > &u) const
 Evaluates the objective function.
 
void gradObj_into (const gsAsConstVector< T > &u, gsAsVector< T > &result) const
 Computes the gradient of the objective function.
 
 gsOptProblemStatic (const typename gsStructuralAnalysisOps< T >::ALResidual_t &ALresidualFun, const T &L, index_t numDesignVars)
 Constructor for gsOptProblemStatic with arc-length residual function.
 
 gsOptProblemStatic (const typename gsStructuralAnalysisOps< T >::Residual_t &residualFun, const T &L, index_t numDesignVars)
 Constructor for gsOptProblemStatic.
 
virtual void hessLagr_into (const gsAsConstVector< T > &, gsAsVector< T > &) const
 Returns Hessian Lagrangian of the constraints at design value.
 
virtual void jacobCon_into (const gsAsConstVector< T > &, gsAsVector< T > &) const
 Returns Jacobian of the constraints at design value u. Format of result is sparse, complying to m_conJacRows and m_conJacCols.
 
int numDesignVars () const
 Callback function is executed after every iteration. Returning false causes premature termination of the optimization.
 

Protected Attributes

gsMatrix< T > m_lambda
 Lagrange multipliers (set in the finalize_solution method)
 

Private Attributes

std::vector< index_tm_conJacCols
 Constraint Jacobian non-zero entries columns.
 
std::vector< index_tm_conJacRows
 Constraint Jacobian non-zero entries rows.
 
gsVector< T > m_conLowerBounds
 Lower bounds for the constraints.
 
gsVector< T > m_conUpperBounds
 Upper bounds for the constraints.
 
gsMatrix< T > m_curDesign
 Current design variables (and starting point )
 
gsVector< T > m_desLowerBounds
 Lower bounds for the design variables.
 
gsVector< T > m_desUpperBounds
 Upper bounds for the design variables.
 
int m_numConJacNonZero
 Number of nonzero entries in the Constraint Jacobian.
 
int m_numConstraints
 Number of constraints.
 
int m_numDesignVars
 Number of design variables.
 

Constructor & Destructor Documentation

◆ gsOptProblemStatic() [1/2]

template<typename T >
gsOptProblemStatic ( const typename gsStructuralAnalysisOps< T >::Residual_t &  residualFun,
const T &  L,
index_t  numDesignVars 
)
inline

Constructor for gsOptProblemStatic.

Parameters
residualFunThe residual function.
LA coefficient (unused but needs to be assigned).
numDesignVarsThe number of design variables.

◆ gsOptProblemStatic() [2/2]

template<typename T >
gsOptProblemStatic ( const typename gsStructuralAnalysisOps< T >::ALResidual_t &  ALresidualFun,
const T &  L,
index_t  numDesignVars 
)
inline

Constructor for gsOptProblemStatic with arc-length residual function.

Parameters
ALresidualFunThe arc-length residual function.
LA coefficient.
numDesignVarsThe number of design variables.

Member Function Documentation

◆ computeJacStructure()

template<typename T >
virtual void computeJacStructure ( )
inlinevirtualinherited

Computes the sparsity pattern of the constraint Jacobian matrix.

Number of constraints and design variables need to be set before calling this. By default the constraint Jacobian is set to full. Override this function to provide sparsity.

◆ evalObj()

template<typename T >
T evalObj ( const gsAsConstVector< T > &  u) const
inlinevirtual

Evaluates the objective function.

Parameters
uThe input vector.
Returns
The norm of the residual.

Reimplemented from gsOptProblem< T >.

◆ gradObj_into()

template<typename T >
void gradObj_into ( const gsAsConstVector< T > &  u,
gsAsVector< T > &  result 
) const
inlinevirtual

Computes the gradient of the objective function.

Parameters
uThe input vector.
resultThe output vector for the gradient.

Reimplemented from gsOptProblem< T >.