49 lines
1.3 KiB
Python
49 lines
1.3 KiB
Python
|
|
"""
|
||
|
|
Quick check: Verify NX installation can be found
|
||
|
|
"""
|
||
|
|
|
||
|
|
from pathlib import Path
|
||
|
|
import sys
|
||
|
|
|
||
|
|
project_root = Path(__file__).parent.parent
|
||
|
|
sys.path.insert(0, str(project_root))
|
||
|
|
|
||
|
|
from optimization_engine.nx_solver import NXSolver
|
||
|
|
|
||
|
|
print("="*60)
|
||
|
|
print("NX INSTALLATION CHECK")
|
||
|
|
print("="*60)
|
||
|
|
|
||
|
|
try:
|
||
|
|
solver = NXSolver(nastran_version="2412")
|
||
|
|
|
||
|
|
print("\n✓ NX Solver found!")
|
||
|
|
print(f"\nInstallation:")
|
||
|
|
print(f" Directory: {solver.nx_install_dir}")
|
||
|
|
print(f" Solver: {solver.solver_exe}")
|
||
|
|
print(f"\nSolver executable exists: {solver.solver_exe.exists()}")
|
||
|
|
|
||
|
|
if solver.solver_exe.exists():
|
||
|
|
print(f"Solver size: {solver.solver_exe.stat().st_size / (1024*1024):.1f} MB")
|
||
|
|
|
||
|
|
print("\n" + "="*60)
|
||
|
|
print("READY TO USE!")
|
||
|
|
print("="*60)
|
||
|
|
print("\nNext step: Run test_nx_solver.py to verify solver execution")
|
||
|
|
|
||
|
|
except FileNotFoundError as e:
|
||
|
|
print(f"\n✗ Error: {e}")
|
||
|
|
print("\nPlease check:")
|
||
|
|
print(" - NX 2412 is installed")
|
||
|
|
print(" - Installation is at standard location")
|
||
|
|
print("\nTry specifying path manually:")
|
||
|
|
print(" solver = NXSolver(")
|
||
|
|
print(" nx_install_dir=Path('C:/your/path/to/NX2412'),")
|
||
|
|
print(" nastran_version='2412'")
|
||
|
|
print(" )")
|
||
|
|
|
||
|
|
except Exception as e:
|
||
|
|
print(f"\n✗ Unexpected error: {e}")
|
||
|
|
import traceback
|
||
|
|
traceback.print_exc()
|