Skip to content

Commit 14b2184

Browse files
committed
interface draft
1 parent e793cee commit 14b2184

File tree

1 file changed

+72
-0
lines changed

1 file changed

+72
-0
lines changed

src/Interface/hiopInterface.hpp

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,78 @@ class hiopInterfaceBase
279279
return false; // defaults to serial
280280
}
281281

282+
/**
283+
* Computes action y of the mass matrix on a vector x, namely y=M*x
284+
*
285+
* The mass matrix is generally the weight matrix associated with L^2 finite element
286+
* discretizations. This matrix is used internally to build and maintain Riesz-like
287+
* representations of the dual variables (associated with bound constraints) to ensure
288+
* mesh independent performance of the algorithm.
289+
*
290+
* @note If the variables are not coming from L^2 discretizations, this method should
291+
* return false on its first call. HiOp will use internally the identity as the mass
292+
* matrix in this case. Otherwise should return true on its first call; subsequent
293+
* errors in matrix apply can be flagged with false return values.
294+
*
295+
* @param[in] n the (global) number of variables
296+
* @param[in] x the array to which mass action is applied
297+
* @param[out] y the result of apply
298+
* @return true if successful, false otherwise (also see note above).
299+
*/
300+
virtual bool applyM(const size_type& n, const double* x, double* y)
301+
{
302+
//the default impl. instructs HiOp to use Euclidean/l^2 variables (M=I) internally
303+
return false;
304+
}
305+
306+
/**
307+
* Computes action y of the inner product weight matrix H on a vector x, namely y=H*x
308+
*
309+
* The weight matrix H is generally associated with L^2 or H^1 finite element
310+
* discretizations and corresponding weighted inner products: <u_h,v_h> = u^T H v. For L^2,
311+
* H is the mass matrix, while for H^1 is the mass plus stiffness. This matrix is applied
312+
* internally to obtain termination criteria and derive Hessian representations that are
313+
* mesh independent and consistent with the function space nature of the problem.
314+
*
315+
* Additional info: C. G. Petra et. al., On the implementation of a quasi-Newton
316+
* interior-point method for PDE-constrained optimization using finite element
317+
* discretizations, Optimiz. Meth. and Software, Vol. 38, 2023.
318+
*
319+
* @note If the variables are not coming from L^2 discretizations, this method should
320+
* return false on its first call. HiOp will use internally H=I in this case. Otherwise
321+
* should return true on its first call; subsequent errors in matrix apply can be flagged
322+
* with false return values.
323+
*
324+
* @param[in] n the (global) number of variables
325+
* @param[in] x the array to which the H matrix is applied
326+
* @param[out] y the result of apply
327+
* @return true if successful, false otherwise (also see note above)
328+
*/
329+
virtual bool applyH(const size_type& n, const double* x, double* y)
330+
{
331+
//the default impl. instructs HiOp to use Euclidean/l^2 variables (H=I) internally
332+
return false;
333+
}
334+
335+
/**
336+
* Computes action y of the inverse of H on a vector x, namely y=H^{-1}*x
337+
*
338+
* See @applyH for a discussion of H and additional notes. The inverse of H plays an
339+
* important role in computing the "dual" norms and, in turn, to ensure mesh
340+
* independent behavior of the IPM solver(s). The inverse apply is also needed by the
341+
* specialized solves HiOp performs when the quasi-Newton solver is used.
342+
*
343+
* @param[in] n the (global) number of variables
344+
* @param[in] x the array to which the inverse is applied
345+
* @param[out] y the result of apply
346+
* @return see return of @applyH
347+
*/
348+
virtual bool applyHinv(const size_type& n, const double* x, double* y)
349+
{
350+
//the default impl. instructs HiOp to use Euclidean/l^2 variables (H=I) internally
351+
return false;
352+
}
353+
282354
/**
283355
* Method provides a primal or starting point. This point is subject to internal adjustments.
284356
*

0 commit comments

Comments
 (0)