From c90c605913e93f760e4211e33de3fbe8912400e0 Mon Sep 17 00:00:00 2001 From: Rafael Pastrana Date: Sun, 26 Jan 2025 20:38:41 -0500 Subject: [PATCH] [Eq] `datastructure_validate` reports the number of edges with zero q --- src/jax_fdm/equilibrium/fdm.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/jax_fdm/equilibrium/fdm.py b/src/jax_fdm/equilibrium/fdm.py index f932b1a..5d48d37 100644 --- a/src/jax_fdm/equilibrium/fdm.py +++ b/src/jax_fdm/equilibrium/fdm.py @@ -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"