LagrangeMultiplier
-
class LagrangeMultiplier
Public Functions
-
inline LagrangeMultiplier()
Empty constructor to allow passing by reference.
Warning
Do not instantiate using this constructor! This is only provided as a means to pass by reference to the Hyperoptimization class.
-
inline LagrangeMultiplier(FilterWrapper &filter, PetscScalar volfrac)
Correct constructor to use.
- Parameters:
filter – abstracted filter wrapper. Note it is passed by reference to allow for any arbitrary filter implementation.
volfrac – target volume fraction of the system.
-
virtual PetscScalar computeLagrangeMultiplier(Vec positions, Vec C, PetscInt numParticles, PetscScalar *LagrangeMultiplier)
Default Lagrange multiplier calculation.
For any given problem, this function can be overwritten by derived classes to implement the Lagrange Multiplier calculation specific to said problem. This particular function implements the following equation:
\[ \lambda = \frac{N c_v - \sum_i^N{\tilde{x_i}}}{\sum_i^N{\tilde{C_i}}}, \]where:
\( \lambda \) is the Lagrange multiplier,
\( N \) is the number of design particles in the system,
\( c_v \) is volume fraction,
\( \tilde{x_i} \) is the i’th filtered design variable position,
\( \tilde{C_i} \) is the i’th filtered C vector element.
- Todo:
See the hyperoptimization summary for the C vector definition.
- Parameters:
positions – vector of design variable positions.
C – the C vector.
numParticles – the number of design variable particles.
LagrangeMultiplier – [out] the resulting Lagrange Multiplier.
- Returns:
0 on success, PetscError otherwise.
-
inline LagrangeMultiplier()