Skip to content

Commit

Permalink
MAINT: Minor changes related to diff-tpfa
Browse files Browse the repository at this point in the history
  • Loading branch information
keileg committed Jan 11, 2024
1 parent 97c0f21 commit 56bbd5c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
7 changes: 3 additions & 4 deletions src/porepy/models/constitutive_laws.py
Original file line number Diff line number Diff line change
Expand Up @@ -2016,10 +2016,9 @@ def __mpfa_bound_pressure_discretization(
# Otherwise, at the time of evaluation, internal_flux will be an AdArray, thus
# we can access its val and jac attributes.

# EK: Testing on a case with no internal boundaries revealed a case where the
# external_bc was an AdArray. The precise reason for this is not clear (it could
# be a straightforward result of the rules of parsing), but to cover all cases,
# we do a if-else here.
# EK: Testing revealed a case where the external_bc was an AdArray. The precise
# reason for this is not clear (it could be a straightforward result of the
# rules of parsing), but to cover all cases, we do a if-else here.
if isinstance(external_bc, pp.ad.AdArray):
external_bc_val = external_bc.val
else:
Expand Down
5 changes: 0 additions & 5 deletions tests/numerics/fv/test_tpfa.py
Original file line number Diff line number Diff line change
Expand Up @@ -749,13 +749,8 @@ def permeability(self, subdomains: list[pp.Grid]) -> pp.ad.Operator:
all_vals[4::tensor_dim] = 1
all_vals[8::tensor_dim] = 1

# Basis vector for the yy-component
e_yy = self.e_i(subdomains, i=4, dim=tensor_dim)

return pp.wrap_as_dense_ad_array(
all_vals, name="Constant_permeability_component"
) + e_yy @ self.pressure(subdomains) * pp.ad.Scalar(
0 # Note the 0 here
)


Expand Down

0 comments on commit 56bbd5c

Please sign in to comment.