Skip to content

Commit

Permalink
[Eq] datastructure_validate reports the number of edges with zero q
Browse files Browse the repository at this point in the history
  • Loading branch information
arpastrana committed Jan 27, 2025
1 parent 2dbd985 commit c90c605
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/jax_fdm/equilibrium/fdm.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,10 @@ def datastructure_validate(datastructure):
"""
assert datastructure.number_of_supports() > 0, "The FD datastructure has no supports"
assert datastructure.number_of_edges() > 0, "The FD datastructure has no edges"
assert np.all(np.abs(np.array(datastructure.edges_forcedensities())) > 0.0), "The FD datastructure has edges with zero force density"

has_fd = np.abs(np.array(datastructure.edges_forcedensities())) > 0.0
num_no_fd = np.sum(np.logical_not(has_fd).astype(float))
assert np.all(has_fd), f"The FD datastructure has {int(num_no_fd)} edges with zero force density"

try:
assert datastructure.number_of_nodes() > 0, "The FD datastructure has no nodes"
Expand Down

0 comments on commit c90c605

Please sign in to comment.