Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update ParOpt interface to support sparse constraints #409

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions pyoptsparse/pyParOpt/ParOpt.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,39 @@
A[i][:] = -gcon[i][:]
return fail

def evalSparseCon(self, x, out):
"""Evaluate the sparse constraints.

Give the design variable vector x, compute the sparse constraints.

Parameters
----------
x : array
Design variable vector
out : array
Sparse constraint values
"""
pass

Check warning on line 227 in pyoptsparse/pyParOpt/ParOpt.py

View check run for this annotation

Codecov / codecov/patch

pyoptsparse/pyParOpt/ParOpt.py#L227

Added line #L227 was not covered by tests

def addSparseJacobian(self, alpha, x, px, out):
"""Compute the Jacobian-vector product of the sparse constraints.

This code computes the action of the Jacobian of the sparse constraint matrix on the input vector px
, to compute out = alpha*J(x)*px.

Parameters
----------
alpha : float
Scaling factor for the Jacobian-vector product
x : array
Design variable vector
px : array
Array to multiply the Jacobian by
out : array
Vector to store the result of the Jacobian-vector product
"""
pass

Check warning on line 246 in pyoptsparse/pyParOpt/ParOpt.py

View check run for this annotation

Codecov / codecov/patch

pyoptsparse/pyParOpt/ParOpt.py#L246

Added line #L246 was not covered by tests

optTime = MPI.Wtime()

# Optimize the problem
Expand Down
Loading