11 #ifndef OPTIMIZATION_UTILITIES_H
12 #define OPTIMIZATION_UTILITIES_H
86 static void ComputeControlPointUpdate(
ModelPart& rModelPart,
const double StepSize,
const bool Normalize);
106 static void ComputeSearchDirectionSteepestDescent(
ModelPart& rModelPart);
111 static void ComputeProjectedSearchDirection(
ModelPart& rModelPart);
114 static double CorrectProjectedSearchDirection(
ModelPart& rModelPart,
const double PrevConstraintValue,
const double ConstraintValue,
const double CorrectionScaling,
const bool IsAdaptive );
117 static double ComputeCorrectionFactor(
ModelPart& rModelPart,
const double PrevConstraintValue,
const double ConstraintValue,
double& CorrectionScaling,
const bool IsAdaptive);
122 static void AssembleVector(
ModelPart& rModelPart,
129 static void AssembleVector(
ModelPart& rModelPart,
136 static void AssignVectorToVariable(
ModelPart& rModelPart,
143 static void AssignVectorToVariable(
ModelPart& rModelPart,
151 static void AssembleMatrix(
ModelPart& rModelPart,
162 static void CalculateProjectedSearchDirectionAndCorrection(
163 Vector& rObjectiveGradient,
164 Matrix& rConstraintGradients,
165 Vector& rConstraintValues,
167 Vector& rProjectedSearchDirection,
178 const std::vector<double>& rVariables)
180 size_t VectorSize = rVariables.size();
191 Vector& rObjectiveGradient,
192 Matrix& rConstraintGradients,
193 Matrix& rRelaxationCoefficients,
194 Vector& rCorrectionCoefficients,
196 Vector& rProjectedSearchDirection,
201 Vector& nabla_f = rObjectiveGradient;
202 Matrix&
N = rConstraintGradients;
203 Vector& s = rProjectedSearchDirection;
205 Matrix& omega_r = rRelaxationCoefficients;
206 Vector& omega_c = rCorrectionCoefficients;
211 Matrix NTN_inv(NTN.size1(), NTN.size2());
213 rSolver.
Solve(NTN, NTN_inv, I);
This class is useful for index iteration over containers.
Definition: parallel_utilities.h:451
void for_each(TUnaryFunction &&f)
Definition: parallel_utilities.h:514
Base class for all the linear solvers in Kratos.
Definition: linear_solver.h:65
virtual bool Solve(SparseMatrixType &rA, VectorType &rX, VectorType &rB)
Definition: linear_solver.h:186
This class aims to manage meshes for multi-physics simulations.
Definition: model_part.h:77
Short class definition.
Definition: optimization_utilities.h:59
KRATOS_CLASS_POINTER_DEFINITION(OptimizationUtilities)
Pointer definition of OptimizationUtilities.
static void AssembleBufferMatrix(Matrix &rMatrix, const std::vector< double > &rVariables)
Definition: optimization_utilities.h:177
static void CalculateRelaxedProjectedSearchDirectionAndCorrection(Vector &rObjectiveGradient, Matrix &rConstraintGradients, Matrix &rRelaxationCoefficients, Vector &rCorrectionCoefficients, LinearSolver< DenseSpace, DenseSpace > &rSolver, Vector &rProjectedSearchDirection, Vector &rCorrection)
Definition: optimization_utilities.h:190
UblasSpace< double, Matrix, Vector > DenseSpace
Definition: optimization_utilities.h:65
array_1d< double, 3 > array_3d
Definition: optimization_utilities.h:64
A class template for handling data types, matrices, and vectors in a Ublas space.
Definition: ublas_space.h:121
Variable class contains all information needed to store and retrive data from a data container.
Definition: variable.h:63
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
AMatrix::IdentityMatrix< double > IdentityMatrix
Definition: amatrix_interface.h:564
Internals::Matrix< double, AMatrix::dynamic, 1 > Vector
Definition: amatrix_interface.h:472
KratosZeroMatrix< double > ZeroMatrix
Definition: amatrix_interface.h:559
AMatrix::MatrixProductExpression< TExpression1Type, TExpression2Type > prod(AMatrix::MatrixExpression< TExpression1Type, TCategory1 > const &First, AMatrix::MatrixExpression< TExpression2Type, TCategory2 > const &Second)
Definition: amatrix_interface.h:568
AMatrix::TransposeMatrix< const T > trans(const T &TheMatrix)
Definition: amatrix_interface.h:486
def Normalize(v)
Definition: embedded.py:28
c
Definition: generate_weakly_compressible_navier_stokes_element.py:108
N
Definition: sensitivityMatrix.py:29
integer i
Definition: TensorModule.f:17