Skip to content

Commit

Permalink
Fixed "project_to_admissible_set" to return no value
Browse files Browse the repository at this point in the history
  • Loading branch information
sblauth committed Nov 18, 2022
1 parent 97a3ee4 commit 7a4ca4d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 11 deletions.
9 changes: 1 addition & 8 deletions cashocs/_forms/control_form_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -327,9 +327,7 @@ def restrict_to_inactive_set(

return b

def project_to_admissible_set(
self, a: List[fenics.Function]
) -> List[fenics.Function]:
def project_to_admissible_set(self, a: List[fenics.Function]) -> None:
"""Project a function to the set of admissible controls.
Projects a control type function ``a`` onto the set of admissible controls
Expand All @@ -339,9 +337,6 @@ def project_to_admissible_set(
a: The function which is to be projected onto the set of admissible
controls (is overwritten)
Returns:
The result of the projection (overwrites input ``a``)
"""
for j in range(self.control_dim):
if self.require_control_constraints[j]:
Expand All @@ -354,8 +349,6 @@ def project_to_admissible_set(
)
a[j].vector().apply("")

return a

def _compute_gradient_equations(self) -> None:
"""Calculates the variational form of the gradient equation."""
self.gradient_forms_rhs = [
Expand Down
4 changes: 1 addition & 3 deletions cashocs/_forms/form_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -320,8 +320,6 @@ def update_scalar_product(self) -> None:
"""Updates the scalar product."""
pass

def project_to_admissible_set(
self, a: List[fenics.Function]
) -> List[fenics.Function]:
def project_to_admissible_set(self, a: List[fenics.Function]) -> None:
"""Projects a function ``a`` onto the admissible set."""
pass

0 comments on commit 7a4ca4d

Please sign in to comment.