Skip to content

CUSP is not defined #7

@StefanosVoulg

Description

@StefanosVoulg

Running through the terminal I get the following error. Without using gpu acceleration.

C:\Users\stefa\Downloads\PyTopo3D-main>python main.py --nelx 32 --nely 16 --nelz 16 --volfrac 0.3 --penal 3.0 --rmin 3.0
[2025-09-19 10:11:25,680] INFO     - Experiment name: topo3d_20250919_101125_d1640b
[2025-09-19 10:11:25,680] INFO     - No obstacle configuration provided, creating a default empty obstacle mask
[2025-09-19 10:11:25,681] INFO     - Combined obstacle and design space masks, 0 elements restricted
[2025-09-19 10:11:25,681] INFO     - Building force vector (using default settings)
[2025-09-19 10:11:25,681] INFO     - Building support constraints (using default settings)
[2025-09-19 10:11:25,683] INFO     - Generated boundary condition visualization arrays
C:\Users\stefa\Downloads\PyTopo3D-main\pytopo3d\utils\results_manager.py:154: UserWarning: This figure includes Axes that are not compatible with tight_layout, so results might be incorrect.
  fig_copy.tight_layout()
[2025-09-19 10:11:26,355] INFO     - Boundary conditions visualization saved to results\topo3d_20250919_101125_d1640b\visualizations\boundary_conditions_and_obstacles.png
[2025-09-19 10:11:26,355] INFO     - Starting optimization with 32x16x16 elements...
[2025-09-19 10:11:26,387] INFO     - Linear solver: PyPardiso (multi-core)
[2025-09-19 10:11:27,592] ERROR    - Error in main function: name 'cusp' is not defined

C:\Users\stefa\Downloads\PyTopo3D-main>

Running the same thing through VSC for example I get the following

$ python run.py
[2025-09-19 10:14:36,007] INFO - Linear solver: PyPardiso (multi-core)
Traceback (most recent call last):
File "C:\Users\stefa\Downloads\PyTopo3D-main\run.py", line 12, in
result = top3d(nelx, nely, nelz, volfrac, penal, rmin, disp_thres)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\stefa\Downloads\PyTopo3D-main\pytopo3d\core\optimizer.py", line 234, in top3d
xnew, change = optimality_criteria_update(
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\stefa\Downloads\PyTopo3D-main\pytopo3d\utils\oc_update.py", line 74, in optimality_criteria_update
) or isinstance(H, cusp.csr_matrix)
^^^^
NameError: name 'cusp' is not defined

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions