radia 1.3.2__tar.gz → 1.3.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {radia-1.3.2 → radia-1.3.4}/LICENSE +93 -93
- {radia-1.3.2/src/radia.egg-info → radia-1.3.4}/PKG-INFO +16 -19
- {radia-1.3.2 → radia-1.3.4}/README.md +15 -18
- {radia-1.3.2 → radia-1.3.4}/docs/API_EXTENSIONS.md +110 -21
- {radia-1.3.2 → radia-1.3.4}/docs/API_REFERENCE.md +90 -22
- {radia-1.3.2 → radia-1.3.4}/docs/CF_BACKGROUND_FIELD_IMPLEMENTATION.md +1 -1
- {radia-1.3.2 → radia-1.3.4}/docs/HMATRIX_USER_GUIDE.md +132 -48
- {radia-1.3.2 → radia-1.3.4}/docs/MATERIAL_API_IMPLEMENTATION.md +21 -8
- {radia-1.3.2 → radia-1.3.4}/docs/NGSOLVE_CF_BACKGROUND_FIELD_DESIGN.md +2 -2
- {radia-1.3.2 → radia-1.3.4}/docs/NGSOLVE_INTEGRATION.md +52 -15
- {radia-1.3.2 → radia-1.3.4}/docs/NGSOLVE_USAGE_GUIDE.md +65 -14
- {radia-1.3.2 → radia-1.3.4}/docs/README.md +68 -68
- {radia-1.3.2 → radia-1.3.4}/docs/scripts/README.md +89 -89
- radia-1.3.4/examples/NGSolve_Integration/README.md +279 -0
- {radia-1.3.2 → radia-1.3.4}/examples/NGSolve_Integration/benchmark_gridfunction_set.py +3 -3
- {radia-1.3.2 → radia-1.3.4}/examples/NGSolve_Integration/demo_batch_evaluation.py +183 -183
- {radia-1.3.2 → radia-1.3.4}/examples/NGSolve_Integration/demo_field_types.py +6 -6
- {radia-1.3.2 → radia-1.3.4}/examples/NGSolve_Integration/example_hmatrix_cache_usage.py +4 -4
- radia-1.3.4/examples/NGSolve_Integration/mesh_magnetization_import/RADIA_TETRA_ROOT_CAUSE.md +62 -0
- radia-1.3.4/examples/NGSolve_Integration/mesh_magnetization_import/README.md +274 -0
- radia-1.3.4/examples/NGSolve_Integration/mesh_magnetization_import/compare_radia_ngsolve_cube.py +191 -0
- radia-1.3.4/examples/NGSolve_Integration/mesh_magnetization_import/cube_hex.vtk +601 -0
- radia-1.3.4/examples/NGSolve_Integration/mesh_magnetization_import/demo_tetrahedral_methods_comparison.py +91 -0
- radia-1.3.4/examples/NGSolve_Integration/mesh_magnetization_import/ngsolve_cube_graded_mesh.vtk +130354 -0
- radia-1.3.4/examples/NGSolve_Integration/mesh_magnetization_import/ngsolve_cube_uniform_field.py +242 -0
- radia-1.3.4/examples/NGSolve_Integration/mesh_magnetization_import/ngsolve_tet_mesh.vtk +130354 -0
- radia-1.3.4/examples/NGSolve_Integration/mesh_magnetization_import/sphere_domain_graded_mesh.vtk +6817 -0
- {radia-1.3.2 → radia-1.3.4}/examples/NGSolve_Integration/test_batch_evaluation.py +5 -5
- {radia-1.3.2 → radia-1.3.4}/examples/NGSolve_Integration/verify_curl_A_equals_B.py +3 -3
- {radia-1.3.2 → radia-1.3.4}/examples/NGSolve_Integration/visualize_field.py +2 -2
- {radia-1.3.2 → radia-1.3.4}/examples/README.md +3 -3
- {radia-1.3.2 → radia-1.3.4}/examples/background_fields/README.md +434 -434
- radia-1.3.2/examples/background_fields/Cubit2Nastran.py → radia-1.3.4/examples/background_fields/cubit_to_nastran.py +59 -59
- {radia-1.3.2 → radia-1.3.4}/examples/background_fields/permeability_comparison.py +278 -278
- {radia-1.3.2 → radia-1.3.4}/examples/background_fields/quadrupole_analytical.py +218 -218
- radia-1.3.4/examples/background_fields/quadrupole_analytical.vtk.vtk +26 -0
- {radia-1.3.2 → radia-1.3.4}/examples/background_fields/sphere_in_quadrupole.py +244 -244
- {radia-1.3.2 → radia-1.3.4}/examples/background_fields/sphere_nastran_analysis.py +534 -529
- {radia-1.3.2 → radia-1.3.4}/examples/complex_coil_geometry/visualize_coils.py +156 -156
- radia-1.3.4/examples/electromagnet/README.md +300 -0
- radia-1.3.4/examples/electromagnet/Radia_model.vtk +4933 -0
- radia-1.3.4/examples/electromagnet/York.vtk +1467 -0
- radia-1.3.4/examples/electromagnet/field_distribution.vtk +27350 -0
- radia-1.3.4/examples/electromagnet/main_simulation_workflow.py +156 -0
- radia-1.3.4/examples/electromagnet/visualize_paraview.py +162 -0
- radia-1.3.4/examples/electromagnet/york_cubit_mesh.py +89 -0
- radia-1.3.4/examples/magnets/README_CUBE_BENCHMARK.md +331 -0
- radia-1.3.4/examples/magnets/cube_benchmark_external_field.py +326 -0
- radia-1.3.4/examples/magnets/cube_benchmark_radia.vtk +225 -0
- {radia-1.3.2 → radia-1.3.4}/examples/simple_problems/CONVERSION_NOTES.md +186 -186
- {radia-1.3.2 → radia-1.3.4}/examples/simple_problems/README.md +134 -134
- {radia-1.3.2 → radia-1.3.4}/examples/smco_magnet_array/README.md +282 -282
- {radia-1.3.2 → radia-1.3.4}/examples/solver_benchmarks/HMATRIX_FIELD_DESIGN.md +1 -1
- {radia-1.3.2 → radia-1.3.4}/examples/solver_benchmarks/HMATRIX_FIELD_DESIGN_SIMPLIFIED.md +7 -7
- {radia-1.3.2 → radia-1.3.4}/examples/solver_benchmarks/benchmark_field_evaluation.py +2 -2
- {radia-1.3.2 → radia-1.3.4}/pyproject.toml +1 -1
- radia-1.3.4/src/python/nastran_mesh_import.py +441 -0
- radia-1.3.4/src/python/netgen_mesh_import.py +572 -0
- {radia-1.3.2 → radia-1.3.4}/src/python/rad_ngsolve.pyd +0 -0
- {radia-1.3.2 → radia-1.3.4}/src/python/radia_field_cached.py +274 -274
- radia-1.3.4/src/python/radia_ngsolve.pyd +0 -0
- radia-1.3.4/src/python/radia_ngsolve_utils.py +293 -0
- radia-1.3.4/src/python/radia_vtk_export.py +221 -0
- {radia-1.3.2 → radia-1.3.4/src/radia.egg-info}/PKG-INFO +16 -19
- {radia-1.3.2 → radia-1.3.4}/src/radia.egg-info/SOURCES.txt +37 -37
- {radia-1.3.2 → radia-1.3.4}/tests/README.md +3 -3
- {radia-1.3.2 → radia-1.3.4}/tests/__init__.py +27 -27
- {radia-1.3.2 → radia-1.3.4}/tests/benchmarks/benchmark_correct.py +243 -243
- {radia-1.3.2 → radia-1.3.4}/tests/benchmarks/benchmark_heavy.py +181 -181
- {radia-1.3.2 → radia-1.3.4}/tests/benchmarks/benchmark_openmp.py +248 -248
- {radia-1.3.2 → radia-1.3.4}/tests/benchmarks/benchmark_threads.py +141 -141
- {radia-1.3.2 → radia-1.3.4}/tests/conftest.py +1 -1
- {radia-1.3.2 → radia-1.3.4}/tests/test_all_spaces.py +151 -151
- radia-1.3.4/tests/test_background_field_debug.py +187 -0
- {radia-1.3.2 → radia-1.3.4}/tests/test_batch_evaluation.py +3 -3
- {radia-1.3.2 → radia-1.3.4}/tests/test_cf_direct.py +69 -69
- {radia-1.3.2 → radia-1.3.4}/tests/test_convergence_hdiv.py +152 -152
- {radia-1.3.2 → radia-1.3.4}/tests/test_curlA_equals_B.py +5 -5
- {radia-1.3.2 → radia-1.3.4}/tests/test_curl_A_detailed.py +142 -142
- {radia-1.3.2 → radia-1.3.4}/tests/test_far_field_accuracy.py +133 -133
- {radia-1.3.2 → radia-1.3.4}/tests/test_fast_preparecache.py +167 -167
- {radia-1.3.2 → radia-1.3.4}/tests/test_fast_simple.py +79 -79
- {radia-1.3.2 → radia-1.3.4}/tests/test_hcurl_vs_hdiv.py +103 -103
- {radia-1.3.2 → radia-1.3.4}/tests/test_hmatrix_cache.py +2 -2
- {radia-1.3.2 → radia-1.3.4}/tests/test_hmatrix_cache_simple.py +5 -5
- {radia-1.3.2 → radia-1.3.4}/tests/test_l2_norm_debug.py +2 -2
- radia-1.3.4/tests/test_memory_allocation_tracking.py +70 -0
- {radia-1.3.2 → radia-1.3.4}/tests/test_minimal_cached.py +57 -57
- radia-1.3.4/tests/test_moving_magnet_memory.py +250 -0
- radia-1.3.4/tests/test_moving_magnet_memory_diagnosis.py +217 -0
- {radia-1.3.2 → radia-1.3.4}/tests/test_objbckg_simple.py +56 -56
- {radia-1.3.2 → radia-1.3.4}/tests/test_objbckgcf_alone.py +71 -71
- {radia-1.3.2 → radia-1.3.4}/tests/test_order1.py +54 -54
- {radia-1.3.2 → radia-1.3.4}/tests/test_preparecache_performance.py +111 -111
- radia-1.3.4/tests/test_process_memory.py +77 -0
- {radia-1.3.2 → radia-1.3.4}/tests/test_python_cached_field.py +200 -200
- {radia-1.3.2 → radia-1.3.4}/tests/test_python_cached_simple.py +141 -141
- {radia-1.3.2 → radia-1.3.4}/tests/test_rad_ngsolve.py +13 -13
- {radia-1.3.2 → radia-1.3.4}/tests/test_rad_ngsolve_diagnostic.py +78 -78
- {radia-1.3.2 → radia-1.3.4}/tests/test_rad_ngsolve_function.py +70 -70
- {radia-1.3.2 → radia-1.3.4}/tests/test_rad_ngsolve_hmatrix.py +5 -5
- radia-1.3.4/tests/test_radia_core_memory.py +110 -0
- radia-1.3.4/tests/test_radia_field_computation_memory.py +158 -0
- radia-1.3.4/tests/test_radia_ngsolve_longrun.py +120 -0
- radia-1.3.4/tests/test_radia_ngsolve_memory_leak.py +130 -0
- radia-1.3.4/tests/test_radia_ngsolve_with_cache.py +135 -0
- radia-1.3.4/tests/test_radia_only_memory.py +206 -0
- {radia-1.3.2 → radia-1.3.4}/tests/test_set_vs_interpolate.py +125 -125
- radia-1.3.4/tests/test_simple_fld_leak.py +55 -0
- radia-1.3.4/tests/test_tetrahedral_solver.py +220 -0
- radia-1.3.4/tests/test_unit_conversion_verify.py +126 -0
- {radia-1.3.2 → radia-1.3.4}/tests/test_utils.py +82 -82
- {radia-1.3.2 → radia-1.3.4}/tests/test_without_B_projection.py +127 -127
- {radia-1.3.2 → radia-1.3.4}/tests/test_without_gridfunction.py +63 -63
- {radia-1.3.2 → radia-1.3.4}/tests/verify_curl_A_equals_B.py +3 -3
- radia-1.3.2/examples/NGSolve_Integration/HMATRIX_ANALYSIS.md +0 -208
- radia-1.3.2/examples/NGSolve_Integration/HMATRIX_FIELD_EVALUATION_ISSUE.md +0 -275
- radia-1.3.2/examples/NGSolve_Integration/H_MATRIX_PARALLEL_OPTIMIZATION.md +0 -417
- radia-1.3.2/examples/NGSolve_Integration/NGBEM_ANALYSIS.md +0 -460
- radia-1.3.2/examples/NGSolve_Integration/NGSOLVE_SET_VS_INTERPOLATE.md +0 -594
- radia-1.3.2/examples/NGSolve_Integration/PROPOSAL_VECTORIZED_API.md +0 -170
- radia-1.3.2/examples/NGSolve_Integration/README.md +0 -365
- radia-1.3.2/examples/NGSolve_Integration/SET_VS_INTERPOLATE_SIMPLE.md +0 -602
- radia-1.3.2/examples/NGSolve_Integration/SOLVER_OPTIMIZATION_PROPOSAL.md +0 -530
- radia-1.3.2/examples/NGSolve_Integration/export_radia_geometry.py +0 -80
- radia-1.3.2/examples/NGSolve_Integration/radia_field.pvsm +0 -9339
- radia-1.3.2/examples/NGSolve_Integration/test_batch_fld.py +0 -138
- radia-1.3.2/examples/NGSolve_Integration/test_coordinate_transform.py +0 -252
- radia-1.3.2/examples/NGSolve_Integration/test_gridfunction_simple.py +0 -72
- radia-1.3.2/examples/NGSolve_Integration/test_mesh_convergence.py +0 -156
- radia-1.3.2/examples/NGSolve_Integration/test_set_vs_interpolate.py +0 -158
- radia-1.3.2/examples/electromagnet/README.md +0 -436
- radia-1.3.2/examples/electromagnet/electromagnet.pvsm +0 -10415
- radia-1.3.2/examples/electromagnet/electromagnet.vtk +0 -3882
- radia-1.3.2/examples/electromagnet/field_distribution.vtk +0 -13680
- radia-1.3.2/examples/electromagnet/magnet.py +0 -232
- radia-1.3.2/examples/electromagnet/racetrack_coil_model.py +0 -187
- radia-1.3.2/examples/electromagnet/yoke_model.py +0 -252
- radia-1.3.2/src/python/nastran_reader.py +0 -295
- radia-1.3.2/src/python/radia.pyd +0 -0
- radia-1.3.2/src/python/radia_vtk_export.py +0 -134
- {radia-1.3.2 → radia-1.3.4}/COPYRIGHT.txt +0 -0
- {radia-1.3.2 → radia-1.3.4}/MANIFEST.in +0 -0
- {radia-1.3.2 → radia-1.3.4}/docs/HMATRIX_BENCHMARKS_RESULTS.md +0 -0
- {radia-1.3.2 → radia-1.3.4}/docs/HMATRIX_ENHANCEMENT_PROPOSAL_2025.md +0 -0
- {radia-1.3.2 → radia-1.3.4}/docs/HMATRIX_IMPLEMENTATION_HISTORY.md +0 -0
- {radia-1.3.2 → radia-1.3.4}/docs/HMATRIX_SERIALIZATION.md +0 -0
- {radia-1.3.2 → radia-1.3.4}/docs/ML_PARAMETER_TUNING.md +0 -0
- {radia-1.3.2 → radia-1.3.4}/docs/hmatrix_field_design.md +0 -0
- {radia-1.3.2 → radia-1.3.4}/examples/background_fields/sphere_nastran_field_mu.pvsm +0 -0
- {radia-1.3.2 → radia-1.3.4}/examples/background_fields/sphere_nastran_geometry.vtk +0 -0
- {radia-1.3.2 → radia-1.3.4}/examples/complex_coil_geometry/README.md +0 -0
- {radia-1.3.2 → radia-1.3.4}/examples/complex_coil_geometry/coil_geometry.vtk +0 -0
- {radia-1.3.2 → radia-1.3.4}/examples/complex_coil_geometry/coil_model.py +0 -0
- {radia-1.3.2 → radia-1.3.4}/examples/complex_coil_geometry/complex_coil.pvsm +0 -0
- {radia-1.3.2 → radia-1.3.4}/examples/complex_coil_geometry/field_map.py +0 -0
- {radia-1.3.2 → radia-1.3.4}/examples/complex_coil_geometry/field_map.vtk +0 -0
- {radia-1.3.2 → radia-1.3.4}/examples/simple_problems/arc_current_dual_magnets.py +0 -0
- {radia-1.3.2 → radia-1.3.4}/examples/simple_problems/arc_current_with_magnet.py +0 -0
- {radia-1.3.2 → radia-1.3.4}/examples/simple_problems/chamfered_pole_piece.py +0 -0
- {radia-1.3.2 → radia-1.3.4}/examples/simple_problems/compare_magpylib.py +0 -0
- {radia-1.3.2 → radia-1.3.4}/examples/simple_problems/cubic_polyhedron_magnet.py +0 -0
- {radia-1.3.2 → radia-1.3.4}/examples/simple_problems/hmatrix_update_magnetization.py +0 -0
- {radia-1.3.2 → radia-1.3.4}/examples/smco_magnet_array/smbo.pvsm +0 -0
- {radia-1.3.2 → radia-1.3.4}/examples/smco_magnet_array/smco_array.py +0 -0
- {radia-1.3.2 → radia-1.3.4}/examples/smco_magnet_array/smco_array.vtk +0 -0
- {radia-1.3.2 → radia-1.3.4}/examples/smco_magnet_array/smco_field_distribution.vtk +0 -0
- {radia-1.3.2 → radia-1.3.4}/examples/solver_benchmarks/BENCHMARK_RESULTS.md +0 -0
- {radia-1.3.2 → radia-1.3.4}/examples/solver_benchmarks/PHASE2B_REEVALUATION.md +0 -0
- {radia-1.3.2 → radia-1.3.4}/examples/solver_benchmarks/README.md +0 -0
- {radia-1.3.2 → radia-1.3.4}/examples/solver_benchmarks/SCALING_RESULTS.md +0 -0
- {radia-1.3.2 → radia-1.3.4}/examples/solver_benchmarks/benchmark_hmatrix_field.py +0 -0
- {radia-1.3.2 → radia-1.3.4}/examples/solver_benchmarks/benchmark_hmatrix_scaling_exact.py +0 -0
- {radia-1.3.2 → radia-1.3.4}/examples/solver_benchmarks/benchmark_large_scale_comparison.py +0 -0
- {radia-1.3.2 → radia-1.3.4}/examples/solver_benchmarks/benchmark_linear_material.py +0 -0
- {radia-1.3.2 → radia-1.3.4}/examples/solver_benchmarks/benchmark_matrix_construction.py +0 -0
- {radia-1.3.2 → radia-1.3.4}/examples/solver_benchmarks/benchmark_parallel_construction.py +0 -0
- {radia-1.3.2 → radia-1.3.4}/examples/solver_benchmarks/benchmark_solver.py +0 -0
- {radia-1.3.2 → radia-1.3.4}/examples/solver_benchmarks/benchmark_solver_comparison.py +0 -0
- {radia-1.3.2 → radia-1.3.4}/examples/solver_benchmarks/benchmark_solver_methods.py +0 -0
- {radia-1.3.2 → radia-1.3.4}/examples/solver_benchmarks/benchmark_solver_scaling.py +0 -0
- {radia-1.3.2 → radia-1.3.4}/examples/solver_benchmarks/benchmark_solver_scaling_extended.py +0 -0
- {radia-1.3.2 → radia-1.3.4}/examples/solver_benchmarks/plot_benchmark_results.py +0 -0
- {radia-1.3.2 → radia-1.3.4}/examples/solver_benchmarks/run_all_benchmarks.py +0 -0
- {radia-1.3.2 → radia-1.3.4}/examples/solver_benchmarks/run_all_hmatrix_benchmarks.py +0 -0
- {radia-1.3.2 → radia-1.3.4}/examples/solver_benchmarks/verify_field_accuracy.py +0 -0
- {radia-1.3.2 → radia-1.3.4}/setup.cfg +0 -0
- {radia-1.3.2 → radia-1.3.4}/setup.py +0 -0
- {radia-1.3.2 → radia-1.3.4}/src/python/__init__.py +0 -0
- {radia-1.3.2 → radia-1.3.4}/src/python/rad_ngsolve_fast.py +0 -0
- {radia-1.3.2 → radia-1.3.4}/src/python/radia_coil_builder.py +0 -0
- {radia-1.3.2 → radia-1.3.4}/src/python/radia_ngsolve_field.py +0 -0
- {radia-1.3.2 → radia-1.3.4}/src/python/radia_pyvista_viewer.py +0 -0
- {radia-1.3.2 → radia-1.3.4}/src/radia.egg-info/dependency_links.txt +0 -0
- {radia-1.3.2 → radia-1.3.4}/src/radia.egg-info/not-zip-safe +0 -0
- {radia-1.3.2 → radia-1.3.4}/src/radia.egg-info/requires.txt +0 -0
- {radia-1.3.2 → radia-1.3.4}/src/radia.egg-info/top_level.txt +0 -0
- {radia-1.3.2 → radia-1.3.4}/tests/benchmark_hmatrix.py +0 -0
- {radia-1.3.2 → radia-1.3.4}/tests/hmatrix/test_phase2a_final.py +0 -0
- {radia-1.3.2 → radia-1.3.4}/tests/hmatrix/test_phase2a_hmatrix_reuse.py +0 -0
- {radia-1.3.2 → radia-1.3.4}/tests/hmatrix/test_phase2a_with_field.py +0 -0
- {radia-1.3.2 → radia-1.3.4}/tests/hmatrix/test_phase2b_geometry_detection.py +0 -0
- {radia-1.3.2 → radia-1.3.4}/tests/hmatrix/test_phase3_magnetization_update.py +0 -0
- {radia-1.3.2 → radia-1.3.4}/tests/hmatrix/test_phase3b_large_problem.py +0 -0
- {radia-1.3.2 → radia-1.3.4}/tests/hmatrix/test_phase3b_serialization.py +0 -0
- {radia-1.3.2 → radia-1.3.4}/tests/hmatrix/test_phase3b_solver_cache.py +0 -0
- {radia-1.3.2 → radia-1.3.4}/tests/hmatrix/test_serialize_step1_build.py +0 -0
- {radia-1.3.2 → radia-1.3.4}/tests/hmatrix/test_serialize_step2_load.py +0 -0
- {radia-1.3.2 → radia-1.3.4}/tests/hmatrix/test_verify_field_simple.py +0 -0
- {radia-1.3.2 → radia-1.3.4}/tests/profile_batch_performance.py +0 -0
- {radia-1.3.2 → radia-1.3.4}/tests/test_advanced.py +0 -0
- {radia-1.3.2 → radia-1.3.4}/tests/test_group_operations.py +0 -0
- {radia-1.3.2 → radia-1.3.4}/tests/test_magpylib_comparison.py +0 -0
- {radia-1.3.2 → radia-1.3.4}/tests/test_materials.py +0 -0
- {radia-1.3.2 → radia-1.3.4}/tests/test_new_material_api.py +0 -0
- {radia-1.3.2 → radia-1.3.4}/tests/test_parallel_performance.py +0 -0
- {radia-1.3.2 → radia-1.3.4}/tests/test_radhmat.py +0 -0
- {radia-1.3.2 → radia-1.3.4}/tests/test_radia.py +0 -0
- {radia-1.3.2 → radia-1.3.4}/tests/test_serialization.py +0 -0
- {radia-1.3.2 → radia-1.3.4}/tests/test_simple.py +0 -0
- {radia-1.3.2 → radia-1.3.4}/tests/test_square_coil_analytical.py +0 -0
- {radia-1.3.2 → radia-1.3.4}/tests/test_transformations.py +0 -0
- {radia-1.3.2 → radia-1.3.4}/tests/test_type_cast.py +0 -0
- {radia-1.3.2 → radia-1.3.4}/tests/test_update_hmatrix_magnetization.py +0 -0
- {radia-1.3.2 → radia-1.3.4}/tests/test_vector_potential.py +0 -0
|
@@ -1,93 +1,93 @@
|
|
|
1
|
-
RADIA SOFTWARE LICENSE
|
|
2
|
-
======================
|
|
3
|
-
|
|
4
|
-
This software contains multiple components with different licenses:
|
|
5
|
-
|
|
6
|
-
1. RADIA Core (BSD-style License)
|
|
7
|
-
2. HACApK_LH-Cimplm Library (MIT License)
|
|
8
|
-
|
|
9
|
-
All licenses are permissive open-source licenses allowing redistribution
|
|
10
|
-
and modification.
|
|
11
|
-
|
|
12
|
-
================================================================================
|
|
13
|
-
PART 1: RADIA CORE
|
|
14
|
-
================================================================================
|
|
15
|
-
|
|
16
|
-
Copyright © 1997 - 2018, European Synchrotron Radiation Facility
|
|
17
|
-
|
|
18
|
-
The RADIA software is distributed subject to the following license conditions:
|
|
19
|
-
|
|
20
|
-
Redistribution and use in source and binary forms, with or without
|
|
21
|
-
modification, are permitted provided that the following conditions are met:
|
|
22
|
-
|
|
23
|
-
1. Redistributions of source code must retain the above copyright notice,
|
|
24
|
-
this list of conditions and the following disclaimer.
|
|
25
|
-
|
|
26
|
-
2. Redistributions in binary form must reproduce the above copyright notice,
|
|
27
|
-
this list of conditions and the following disclaimer in the documentation
|
|
28
|
-
and/or other materials provided with the distribution.
|
|
29
|
-
|
|
30
|
-
DISCLAIMER: THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS"
|
|
31
|
-
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
32
|
-
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
33
|
-
ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR
|
|
34
|
-
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
35
|
-
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
36
|
-
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
37
|
-
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
38
|
-
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
39
|
-
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
40
|
-
|
|
41
|
-
The views and conclusions contained in the software and documentation are
|
|
42
|
-
those of the authors and should not be interpreted as representing official
|
|
43
|
-
policies, either expressed or implied, of the RADIA project.
|
|
44
|
-
|
|
45
|
-
================================================================================
|
|
46
|
-
PART 2: HACApK_LH-Cimplm (H-matrix Library)
|
|
47
|
-
================================================================================
|
|
48
|
-
|
|
49
|
-
Software Name : HACApK
|
|
50
|
-
Version : 1.3.0
|
|
51
|
-
Location: src/ext/HACApK_LH-Cimplm/
|
|
52
|
-
|
|
53
|
-
Copyright (c) 2015 Akihiro Ida and Takeshi Iwashita
|
|
54
|
-
|
|
55
|
-
MIT License
|
|
56
|
-
|
|
57
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
58
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
59
|
-
in the Software without restriction, including without limitation the rights
|
|
60
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
61
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
62
|
-
furnished to do so, subject to the following conditions:
|
|
63
|
-
|
|
64
|
-
The above copyright notice and this permission notice shall be included in all
|
|
65
|
-
copies or substantial portions of the Software.
|
|
66
|
-
|
|
67
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
68
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
69
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
70
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
71
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
72
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
73
|
-
SOFTWARE.
|
|
74
|
-
|
|
75
|
-
ppOpen-HPC project:
|
|
76
|
-
Open Source Infrastructure for Development and Execution of Large-Scale
|
|
77
|
-
Scientific Applications on Post-Peta-Scale Supercomputers with Automatic
|
|
78
|
-
Tuning (AT).
|
|
79
|
-
|
|
80
|
-
Sponsorship:
|
|
81
|
-
Japan Science and Technology Agency (JST), Basic Research Programs: CREST,
|
|
82
|
-
Development of System Software Technologies for post-Peta Scale High
|
|
83
|
-
Performance Computing.
|
|
84
|
-
|
|
85
|
-
================================================================================
|
|
86
|
-
ADDITIONAL COMPONENTS
|
|
87
|
-
================================================================================
|
|
88
|
-
|
|
89
|
-
This software may include additional third-party libraries and components,
|
|
90
|
-
each governed by their respective licenses. Please refer to the individual
|
|
91
|
-
component directories for specific license information.
|
|
92
|
-
|
|
93
|
-
================================================================================
|
|
1
|
+
RADIA SOFTWARE LICENSE
|
|
2
|
+
======================
|
|
3
|
+
|
|
4
|
+
This software contains multiple components with different licenses:
|
|
5
|
+
|
|
6
|
+
1. RADIA Core (BSD-style License)
|
|
7
|
+
2. HACApK_LH-Cimplm Library (MIT License)
|
|
8
|
+
|
|
9
|
+
All licenses are permissive open-source licenses allowing redistribution
|
|
10
|
+
and modification.
|
|
11
|
+
|
|
12
|
+
================================================================================
|
|
13
|
+
PART 1: RADIA CORE
|
|
14
|
+
================================================================================
|
|
15
|
+
|
|
16
|
+
Copyright © 1997 - 2018, European Synchrotron Radiation Facility
|
|
17
|
+
|
|
18
|
+
The RADIA software is distributed subject to the following license conditions:
|
|
19
|
+
|
|
20
|
+
Redistribution and use in source and binary forms, with or without
|
|
21
|
+
modification, are permitted provided that the following conditions are met:
|
|
22
|
+
|
|
23
|
+
1. Redistributions of source code must retain the above copyright notice,
|
|
24
|
+
this list of conditions and the following disclaimer.
|
|
25
|
+
|
|
26
|
+
2. Redistributions in binary form must reproduce the above copyright notice,
|
|
27
|
+
this list of conditions and the following disclaimer in the documentation
|
|
28
|
+
and/or other materials provided with the distribution.
|
|
29
|
+
|
|
30
|
+
DISCLAIMER: THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS"
|
|
31
|
+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
32
|
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
33
|
+
ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR
|
|
34
|
+
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
35
|
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
36
|
+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
37
|
+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
38
|
+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
39
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
40
|
+
|
|
41
|
+
The views and conclusions contained in the software and documentation are
|
|
42
|
+
those of the authors and should not be interpreted as representing official
|
|
43
|
+
policies, either expressed or implied, of the RADIA project.
|
|
44
|
+
|
|
45
|
+
================================================================================
|
|
46
|
+
PART 2: HACApK_LH-Cimplm (H-matrix Library)
|
|
47
|
+
================================================================================
|
|
48
|
+
|
|
49
|
+
Software Name : HACApK
|
|
50
|
+
Version : 1.3.0
|
|
51
|
+
Location: src/ext/HACApK_LH-Cimplm/
|
|
52
|
+
|
|
53
|
+
Copyright (c) 2015 Akihiro Ida and Takeshi Iwashita
|
|
54
|
+
|
|
55
|
+
MIT License
|
|
56
|
+
|
|
57
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
58
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
59
|
+
in the Software without restriction, including without limitation the rights
|
|
60
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
61
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
62
|
+
furnished to do so, subject to the following conditions:
|
|
63
|
+
|
|
64
|
+
The above copyright notice and this permission notice shall be included in all
|
|
65
|
+
copies or substantial portions of the Software.
|
|
66
|
+
|
|
67
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
68
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
69
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
70
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
71
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
72
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
73
|
+
SOFTWARE.
|
|
74
|
+
|
|
75
|
+
ppOpen-HPC project:
|
|
76
|
+
Open Source Infrastructure for Development and Execution of Large-Scale
|
|
77
|
+
Scientific Applications on Post-Peta-Scale Supercomputers with Automatic
|
|
78
|
+
Tuning (AT).
|
|
79
|
+
|
|
80
|
+
Sponsorship:
|
|
81
|
+
Japan Science and Technology Agency (JST), Basic Research Programs: CREST,
|
|
82
|
+
Development of System Software Technologies for post-Peta Scale High
|
|
83
|
+
Performance Computing.
|
|
84
|
+
|
|
85
|
+
================================================================================
|
|
86
|
+
ADDITIONAL COMPONENTS
|
|
87
|
+
================================================================================
|
|
88
|
+
|
|
89
|
+
This software may include additional third-party libraries and components,
|
|
90
|
+
each governed by their respective licenses. Please refer to the individual
|
|
91
|
+
component directories for specific license information.
|
|
92
|
+
|
|
93
|
+
================================================================================
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: radia
|
|
3
|
-
Version: 1.3.
|
|
3
|
+
Version: 1.3.4
|
|
4
4
|
Summary: Radia 3D Magnetostatics with NGSolve Integration and OpenMP Parallelization
|
|
5
5
|
Home-page: https://github.com/ksugahar/Radia_NGSolve
|
|
6
6
|
Author: Pascal Elleaume
|
|
@@ -88,12 +88,12 @@ pip install radia-ngsolve
|
|
|
88
88
|
# 1. Build radia.pyd (core module)
|
|
89
89
|
.\Build.ps1
|
|
90
90
|
|
|
91
|
-
# 2. Build
|
|
91
|
+
# 2. Build radia_ngsolve.pyd (optional, for NGSolve integration)
|
|
92
92
|
.\Build_NGSolve.ps1
|
|
93
93
|
|
|
94
94
|
# Outputs:
|
|
95
95
|
# - dist/radia.pyd
|
|
96
|
-
# - build/Release/
|
|
96
|
+
# - build/Release/radia_ngsolve.pyd
|
|
97
97
|
```
|
|
98
98
|
|
|
99
99
|
See [README_BUILD.md](README_BUILD.md) for detailed build instructions.
|
|
@@ -117,12 +117,12 @@ print(f"Field: {field} T")
|
|
|
117
117
|
|
|
118
118
|
### NGSolve Integration
|
|
119
119
|
|
|
120
|
-
The `
|
|
120
|
+
The `radia_ngsolve` module provides a C++ CoefficientFunction interface for using Radia magnetic fields in NGSolve FEM analysis.
|
|
121
121
|
|
|
122
122
|
**Function Specification:**
|
|
123
123
|
|
|
124
124
|
```python
|
|
125
|
-
|
|
125
|
+
radia_ngsolve.RadiaField(radia_obj, field_type='b')
|
|
126
126
|
```
|
|
127
127
|
|
|
128
128
|
**Parameters:**
|
|
@@ -149,7 +149,7 @@ import ngsolve
|
|
|
149
149
|
from ngsolve import Mesh, H1, GridFunction
|
|
150
150
|
|
|
151
151
|
import radia as rad
|
|
152
|
-
import
|
|
152
|
+
import radia_ngsolve
|
|
153
153
|
|
|
154
154
|
# Create Radia magnet
|
|
155
155
|
magnet = rad.ObjRecMag([0,0,0], [20,20,20], [0,0,1.2]) # mm units
|
|
@@ -157,10 +157,10 @@ rad.MatApl(magnet, rad.MatPM(1.2, 900000, [0,0,1])) # NdFeB permanent magnet
|
|
|
157
157
|
rad.Solve(magnet, 0.0001, 10000)
|
|
158
158
|
|
|
159
159
|
# Create NGSolve CoefficientFunction for different field types
|
|
160
|
-
B_field =
|
|
161
|
-
H_field =
|
|
162
|
-
A_field =
|
|
163
|
-
M_field =
|
|
160
|
+
B_field = radia_ngsolve.RadiaField(magnet, 'b') # Flux density [T]
|
|
161
|
+
H_field = radia_ngsolve.RadiaField(magnet, 'h') # Magnetic field [A/m]
|
|
162
|
+
A_field = radia_ngsolve.RadiaField(magnet, 'a') # Vector potential [T·m]
|
|
163
|
+
M_field = radia_ngsolve.RadiaField(magnet, 'm') # Magnetization [A/m]
|
|
164
164
|
|
|
165
165
|
# Use in FEM analysis (NGSolve mesh in meters)
|
|
166
166
|
gf = GridFunction(fes)
|
|
@@ -177,13 +177,10 @@ See [examples/Radia_to_NGSolve_CoefficientFunction/](examples/Radia_to_NGSolve_C
|
|
|
177
177
|
- [docs/DIRECTORY_STRUCTURE.md](docs/DIRECTORY_STRUCTURE.md) - Project structure
|
|
178
178
|
|
|
179
179
|
### NGSolve Integration
|
|
180
|
-
- [RAD_NGSOLVE_BUILD_SUCCESS.md](RAD_NGSOLVE_BUILD_SUCCESS.md) - Complete
|
|
180
|
+
- [RAD_NGSOLVE_BUILD_SUCCESS.md](RAD_NGSOLVE_BUILD_SUCCESS.md) - Complete radia_ngsolve documentation
|
|
181
181
|
- [examples/Radia_to_NGSolve_CoefficientFunction/README.md](examples/Radia_to_NGSolve_CoefficientFunction/README.md) - NGSolve examples overview
|
|
182
182
|
- [examples/Radia_to_NGSolve_CoefficientFunction/EXAMPLES_GUIDE.md](examples/Radia_to_NGSolve_CoefficientFunction/EXAMPLES_GUIDE.md) - Detailed usage guide
|
|
183
|
-
- [tests/
|
|
184
|
-
|
|
185
|
-
### Visualization
|
|
186
|
-
- [docs/PYVISTA_VIEWER.md](examples/2024_02_03_振分電磁石/PYVISTA_VIEWER.md) - PyVista viewer guide
|
|
183
|
+
- [tests/test_radia_ngsolve.py](tests/test_radia_ngsolve.py) - Integration tests
|
|
187
184
|
|
|
188
185
|
### Development
|
|
189
186
|
- [docs/TAB_CONVERSION_REPORT.md](docs/TAB_CONVERSION_REPORT.md) - Code style conversion
|
|
@@ -239,7 +236,7 @@ python tests/test_radia.py
|
|
|
239
236
|
python tests/test_advanced.py
|
|
240
237
|
|
|
241
238
|
# NGSolve integration test
|
|
242
|
-
python tests/
|
|
239
|
+
python tests/test_radia_ngsolve.py
|
|
243
240
|
|
|
244
241
|
# OpenMP performance test
|
|
245
242
|
python tests/test_parallel_performance.py
|
|
@@ -248,7 +245,7 @@ python tests/test_parallel_performance.py
|
|
|
248
245
|
pytest tests/
|
|
249
246
|
|
|
250
247
|
# Run specific test suite
|
|
251
|
-
pytest tests/
|
|
248
|
+
pytest tests/test_radia_ngsolve.py -v
|
|
252
249
|
```
|
|
253
250
|
|
|
254
251
|
See [tests/README.md](tests/README.md) for detailed testing documentation.
|
|
@@ -296,7 +293,7 @@ export_geometry_to_vtk(mag, 'geometry.vtk')
|
|
|
296
293
|
### Runtime Requirements
|
|
297
294
|
- Python 3.12
|
|
298
295
|
- NumPy
|
|
299
|
-
- NGSolve (optional, for FEM coupling via
|
|
296
|
+
- NGSolve (optional, for FEM coupling via radia_ngsolve)
|
|
300
297
|
- PyVista (optional, for 3D visualization)
|
|
301
298
|
|
|
302
299
|
## Changes from Original Radia
|
|
@@ -348,7 +345,7 @@ See:
|
|
|
348
345
|
|
|
349
346
|
**This Fork**:
|
|
350
347
|
- OpenMP parallelization
|
|
351
|
-
- NGSolve C++ integration (
|
|
348
|
+
- NGSolve C++ integration (radia_ngsolve)
|
|
352
349
|
- Python 3.12 optimization
|
|
353
350
|
- Build system modernization
|
|
354
351
|
- PyVista integration
|
|
@@ -46,12 +46,12 @@ pip install radia-ngsolve
|
|
|
46
46
|
# 1. Build radia.pyd (core module)
|
|
47
47
|
.\Build.ps1
|
|
48
48
|
|
|
49
|
-
# 2. Build
|
|
49
|
+
# 2. Build radia_ngsolve.pyd (optional, for NGSolve integration)
|
|
50
50
|
.\Build_NGSolve.ps1
|
|
51
51
|
|
|
52
52
|
# Outputs:
|
|
53
53
|
# - dist/radia.pyd
|
|
54
|
-
# - build/Release/
|
|
54
|
+
# - build/Release/radia_ngsolve.pyd
|
|
55
55
|
```
|
|
56
56
|
|
|
57
57
|
See [README_BUILD.md](README_BUILD.md) for detailed build instructions.
|
|
@@ -75,12 +75,12 @@ print(f"Field: {field} T")
|
|
|
75
75
|
|
|
76
76
|
### NGSolve Integration
|
|
77
77
|
|
|
78
|
-
The `
|
|
78
|
+
The `radia_ngsolve` module provides a C++ CoefficientFunction interface for using Radia magnetic fields in NGSolve FEM analysis.
|
|
79
79
|
|
|
80
80
|
**Function Specification:**
|
|
81
81
|
|
|
82
82
|
```python
|
|
83
|
-
|
|
83
|
+
radia_ngsolve.RadiaField(radia_obj, field_type='b')
|
|
84
84
|
```
|
|
85
85
|
|
|
86
86
|
**Parameters:**
|
|
@@ -107,7 +107,7 @@ import ngsolve
|
|
|
107
107
|
from ngsolve import Mesh, H1, GridFunction
|
|
108
108
|
|
|
109
109
|
import radia as rad
|
|
110
|
-
import
|
|
110
|
+
import radia_ngsolve
|
|
111
111
|
|
|
112
112
|
# Create Radia magnet
|
|
113
113
|
magnet = rad.ObjRecMag([0,0,0], [20,20,20], [0,0,1.2]) # mm units
|
|
@@ -115,10 +115,10 @@ rad.MatApl(magnet, rad.MatPM(1.2, 900000, [0,0,1])) # NdFeB permanent magnet
|
|
|
115
115
|
rad.Solve(magnet, 0.0001, 10000)
|
|
116
116
|
|
|
117
117
|
# Create NGSolve CoefficientFunction for different field types
|
|
118
|
-
B_field =
|
|
119
|
-
H_field =
|
|
120
|
-
A_field =
|
|
121
|
-
M_field =
|
|
118
|
+
B_field = radia_ngsolve.RadiaField(magnet, 'b') # Flux density [T]
|
|
119
|
+
H_field = radia_ngsolve.RadiaField(magnet, 'h') # Magnetic field [A/m]
|
|
120
|
+
A_field = radia_ngsolve.RadiaField(magnet, 'a') # Vector potential [T·m]
|
|
121
|
+
M_field = radia_ngsolve.RadiaField(magnet, 'm') # Magnetization [A/m]
|
|
122
122
|
|
|
123
123
|
# Use in FEM analysis (NGSolve mesh in meters)
|
|
124
124
|
gf = GridFunction(fes)
|
|
@@ -135,13 +135,10 @@ See [examples/Radia_to_NGSolve_CoefficientFunction/](examples/Radia_to_NGSolve_C
|
|
|
135
135
|
- [docs/DIRECTORY_STRUCTURE.md](docs/DIRECTORY_STRUCTURE.md) - Project structure
|
|
136
136
|
|
|
137
137
|
### NGSolve Integration
|
|
138
|
-
- [RAD_NGSOLVE_BUILD_SUCCESS.md](RAD_NGSOLVE_BUILD_SUCCESS.md) - Complete
|
|
138
|
+
- [RAD_NGSOLVE_BUILD_SUCCESS.md](RAD_NGSOLVE_BUILD_SUCCESS.md) - Complete radia_ngsolve documentation
|
|
139
139
|
- [examples/Radia_to_NGSolve_CoefficientFunction/README.md](examples/Radia_to_NGSolve_CoefficientFunction/README.md) - NGSolve examples overview
|
|
140
140
|
- [examples/Radia_to_NGSolve_CoefficientFunction/EXAMPLES_GUIDE.md](examples/Radia_to_NGSolve_CoefficientFunction/EXAMPLES_GUIDE.md) - Detailed usage guide
|
|
141
|
-
- [tests/
|
|
142
|
-
|
|
143
|
-
### Visualization
|
|
144
|
-
- [docs/PYVISTA_VIEWER.md](examples/2024_02_03_振分電磁石/PYVISTA_VIEWER.md) - PyVista viewer guide
|
|
141
|
+
- [tests/test_radia_ngsolve.py](tests/test_radia_ngsolve.py) - Integration tests
|
|
145
142
|
|
|
146
143
|
### Development
|
|
147
144
|
- [docs/TAB_CONVERSION_REPORT.md](docs/TAB_CONVERSION_REPORT.md) - Code style conversion
|
|
@@ -197,7 +194,7 @@ python tests/test_radia.py
|
|
|
197
194
|
python tests/test_advanced.py
|
|
198
195
|
|
|
199
196
|
# NGSolve integration test
|
|
200
|
-
python tests/
|
|
197
|
+
python tests/test_radia_ngsolve.py
|
|
201
198
|
|
|
202
199
|
# OpenMP performance test
|
|
203
200
|
python tests/test_parallel_performance.py
|
|
@@ -206,7 +203,7 @@ python tests/test_parallel_performance.py
|
|
|
206
203
|
pytest tests/
|
|
207
204
|
|
|
208
205
|
# Run specific test suite
|
|
209
|
-
pytest tests/
|
|
206
|
+
pytest tests/test_radia_ngsolve.py -v
|
|
210
207
|
```
|
|
211
208
|
|
|
212
209
|
See [tests/README.md](tests/README.md) for detailed testing documentation.
|
|
@@ -254,7 +251,7 @@ export_geometry_to_vtk(mag, 'geometry.vtk')
|
|
|
254
251
|
### Runtime Requirements
|
|
255
252
|
- Python 3.12
|
|
256
253
|
- NumPy
|
|
257
|
-
- NGSolve (optional, for FEM coupling via
|
|
254
|
+
- NGSolve (optional, for FEM coupling via radia_ngsolve)
|
|
258
255
|
- PyVista (optional, for 3D visualization)
|
|
259
256
|
|
|
260
257
|
## Changes from Original Radia
|
|
@@ -306,7 +303,7 @@ See:
|
|
|
306
303
|
|
|
307
304
|
**This Fork**:
|
|
308
305
|
- OpenMP parallelization
|
|
309
|
-
- NGSolve C++ integration (
|
|
306
|
+
- NGSolve C++ integration (radia_ngsolve)
|
|
310
307
|
- Python 3.12 optimization
|
|
311
308
|
- Build system modernization
|
|
312
309
|
- PyVista integration
|
|
@@ -4,7 +4,7 @@ This document describes custom extensions to the original ESRF Radia API.
|
|
|
4
4
|
|
|
5
5
|
**Original Documentation**: https://www.esrf.fr/home/Accelerators/instrumentation--equipment/Software/Radia/Documentation/ReferenceGuide.html
|
|
6
6
|
|
|
7
|
-
**Date**: 2025-11-
|
|
7
|
+
**Date**: 2025-11-27
|
|
8
8
|
**Status**: Active development
|
|
9
9
|
|
|
10
10
|
---
|
|
@@ -21,7 +21,7 @@ This document describes custom extensions to the original ESRF Radia API.
|
|
|
21
21
|
- [Performance Features](#performance-features)
|
|
22
22
|
- [SolverHMatrixDisable/Enable](#solverhmatrixdisableenable)
|
|
23
23
|
- [NGSolve Integration](#ngsolve-integration)
|
|
24
|
-
- [
|
|
24
|
+
- [radia_ngsolve.RadiaField](#radia_ngsolveradiafield)
|
|
25
25
|
|
|
26
26
|
---
|
|
27
27
|
|
|
@@ -106,7 +106,7 @@ For use with NGSolve's CoefficientFunction:
|
|
|
106
106
|
|
|
107
107
|
```python
|
|
108
108
|
import ngsolve as ngs
|
|
109
|
-
import
|
|
109
|
+
import radia_ngsolve
|
|
110
110
|
|
|
111
111
|
# Create NGSolve coefficient function (in meters)
|
|
112
112
|
def ngsolve_field_wrapper(x, y, z):
|
|
@@ -116,7 +116,7 @@ def ngsolve_field_wrapper(x, y, z):
|
|
|
116
116
|
return B
|
|
117
117
|
|
|
118
118
|
# Create background field
|
|
119
|
-
bg_cf =
|
|
119
|
+
bg_cf = radia_ngsolve.BackgroundFieldCF(ngsolve_field_wrapper)
|
|
120
120
|
```
|
|
121
121
|
|
|
122
122
|
**Notes**:
|
|
@@ -416,8 +416,97 @@ rad.SolverHMatrixEnable()
|
|
|
416
416
|
|
|
417
417
|
---
|
|
418
418
|
|
|
419
|
+
### SolverTetraMethod
|
|
420
|
+
|
|
421
|
+
**Purpose**: Set the field computation method for tetrahedral mesh elements.
|
|
422
|
+
|
|
423
|
+
**Syntax**:
|
|
424
|
+
```python
|
|
425
|
+
rad.SolverTetraMethod(method)
|
|
426
|
+
```
|
|
427
|
+
|
|
428
|
+
**Parameters**:
|
|
429
|
+
- `method`: Integer selecting the computation method
|
|
430
|
+
- `0`: Original Radia polygon-based method (default)
|
|
431
|
+
- `1`: Analytical method using magnetic charge formulation
|
|
432
|
+
|
|
433
|
+
**Returns**: None
|
|
434
|
+
|
|
435
|
+
**Background**:
|
|
436
|
+
|
|
437
|
+
Tetrahedral elements in Radia can compute their magnetic field contribution using two different algorithms:
|
|
438
|
+
|
|
439
|
+
| Method | Description | Best For |
|
|
440
|
+
|--------|-------------|----------|
|
|
441
|
+
| 0 | Original Radia polygon method | General purpose, standard accuracy |
|
|
442
|
+
| 1 | Analytical method | High-permeability materials (mu_r > 100) |
|
|
443
|
+
|
|
444
|
+
**Method 0 (Original)**:
|
|
445
|
+
- Uses Radia's standard polygon-based field calculation
|
|
446
|
+
- Treats each tetrahedral face as a magnetic charge sheet
|
|
447
|
+
- Well-tested and reliable for most applications
|
|
448
|
+
|
|
449
|
+
**Method 1 (Analytical)**:
|
|
450
|
+
- Uses analytical formulas for magnetic field from surface charges
|
|
451
|
+
- May provide better accuracy for high-permeability soft magnetic materials
|
|
452
|
+
- Mathematically equivalent to Method 0 but with different numerical implementation
|
|
453
|
+
|
|
454
|
+
**Usage Example**:
|
|
455
|
+
|
|
456
|
+
```python
|
|
457
|
+
import radia as rad
|
|
458
|
+
from netgen_mesh_import import netgen_mesh_to_radia
|
|
459
|
+
|
|
460
|
+
# Use analytical method for high-permeability material
|
|
461
|
+
rad.SolverTetraMethod(1)
|
|
462
|
+
|
|
463
|
+
# Import tetrahedral mesh with soft iron (mu_r = 4000)
|
|
464
|
+
mesh_data = netgen_mesh_to_radia(
|
|
465
|
+
'soft_iron.vol',
|
|
466
|
+
material={'magnetization': [0, 0, 0]}, # Zero initial M
|
|
467
|
+
units='m'
|
|
468
|
+
)
|
|
469
|
+
|
|
470
|
+
# Apply linear material
|
|
471
|
+
mat = rad.MatLin(3999) # ksi = mu_r - 1
|
|
472
|
+
rad.MatApl(mesh_data, mat)
|
|
473
|
+
|
|
474
|
+
# Solve
|
|
475
|
+
rad.Solve(mesh_data, 0.0001, 10000)
|
|
476
|
+
|
|
477
|
+
# Compute field
|
|
478
|
+
B = rad.Fld(mesh_data, 'b', [0.1, 0.1, 0.1])
|
|
479
|
+
```
|
|
480
|
+
|
|
481
|
+
**Migration from Environment Variable**:
|
|
482
|
+
|
|
483
|
+
Previously, the tetrahedral method was controlled via the `RADIA_TETRA_METHOD` environment variable. This has been replaced by the `SolverTetraMethod()` API for better discoverability and control.
|
|
484
|
+
|
|
485
|
+
```python
|
|
486
|
+
# Old way (deprecated):
|
|
487
|
+
import os
|
|
488
|
+
os.environ['RADIA_TETRA_METHOD'] = '1' # No longer works
|
|
489
|
+
|
|
490
|
+
# New way (recommended):
|
|
491
|
+
import radia as rad
|
|
492
|
+
rad.SolverTetraMethod(1)
|
|
493
|
+
```
|
|
494
|
+
|
|
495
|
+
**Important Notes**:
|
|
496
|
+
- Setting is global and persists for the session
|
|
497
|
+
- Must be called **before** `rad.Solve()` or `rad.RlxPre()`
|
|
498
|
+
- Both methods should produce identical results (within numerical precision)
|
|
499
|
+
- Method 0 and Method 1 have been verified to produce 0.00% difference
|
|
500
|
+
|
|
501
|
+
---
|
|
502
|
+
|
|
419
503
|
## Version History
|
|
420
504
|
|
|
505
|
+
### v1.0.8 (2025-11-27)
|
|
506
|
+
- Added `SolverTetraMethod()` API for tetrahedral mesh computation method control
|
|
507
|
+
- Fixed ANALYTICAL method (Method 1) to match standard polygon method
|
|
508
|
+
- Deprecated `RADIA_TETRA_METHOD` environment variable
|
|
509
|
+
|
|
421
510
|
### v1.0.7 (2025-11-08)
|
|
422
511
|
- Added `SetRelaxSubInterval()` for LU decomposition control
|
|
423
512
|
- Extended `RlxMan()` to support Method 5 (LU decomposition)
|
|
@@ -436,18 +525,18 @@ rad.SolverHMatrixEnable()
|
|
|
436
525
|
|
|
437
526
|
## NGSolve Integration
|
|
438
527
|
|
|
439
|
-
###
|
|
528
|
+
### radia_ngsolve.RadiaField
|
|
440
529
|
|
|
441
530
|
**Purpose**: Create NGSolve CoefficientFunction for Radia magnetic field with full control over computation accuracy and performance.
|
|
442
531
|
|
|
443
|
-
**Module**: `
|
|
532
|
+
**Module**: `radia_ngsolve` (C++ extension)
|
|
444
533
|
|
|
445
534
|
**Syntax**:
|
|
446
535
|
```python
|
|
447
536
|
from ngsolve import *
|
|
448
|
-
import
|
|
537
|
+
import radia_ngsolve
|
|
449
538
|
|
|
450
|
-
cf =
|
|
539
|
+
cf = radia_ngsolve.RadiaField(
|
|
451
540
|
radia_obj,
|
|
452
541
|
field_type='b',
|
|
453
542
|
origin=None,
|
|
@@ -512,13 +601,13 @@ Controls accuracy vs speed trade-off. Smaller values = more accurate but slower.
|
|
|
512
601
|
|
|
513
602
|
```python
|
|
514
603
|
# High accuracy (slow)
|
|
515
|
-
B_cf =
|
|
604
|
+
B_cf = radia_ngsolve.RadiaField(magnet, 'b', precision=1e-8)
|
|
516
605
|
|
|
517
606
|
# Normal accuracy (default)
|
|
518
|
-
B_cf =
|
|
607
|
+
B_cf = radia_ngsolve.RadiaField(magnet, 'b') # Uses Radia default
|
|
519
608
|
|
|
520
609
|
# Fast evaluation (less accurate)
|
|
521
|
-
B_cf =
|
|
610
|
+
B_cf = radia_ngsolve.RadiaField(magnet, 'b', precision=1e-4)
|
|
522
611
|
```
|
|
523
612
|
|
|
524
613
|
**Internally calls**: `rad.FldCmpPrc()` with specified precision for B, H, A, M fields.
|
|
@@ -531,13 +620,13 @@ Controls H-matrix (hierarchical matrix) acceleration.
|
|
|
531
620
|
|
|
532
621
|
```python
|
|
533
622
|
# Disable H-matrix (accurate for small N)
|
|
534
|
-
B_cf =
|
|
623
|
+
B_cf = radia_ngsolve.RadiaField(magnet, 'b', use_hmatrix=False)
|
|
535
624
|
|
|
536
625
|
# Enable H-matrix (fast for large N > 1000)
|
|
537
|
-
B_cf =
|
|
626
|
+
B_cf = radia_ngsolve.RadiaField(magnet, 'b', use_hmatrix=True)
|
|
538
627
|
|
|
539
628
|
# Keep current setting (default)
|
|
540
|
-
B_cf =
|
|
629
|
+
B_cf = radia_ngsolve.RadiaField(magnet, 'b') # use_hmatrix=None
|
|
541
630
|
```
|
|
542
631
|
|
|
543
632
|
**When to enable H-matrix**:
|
|
@@ -558,13 +647,13 @@ B_cf = rad_ngsolve.RadiaField(magnet, 'b') # use_hmatrix=None
|
|
|
558
647
|
import radia as rad
|
|
559
648
|
from ngsolve import *
|
|
560
649
|
from netgen.occ import *
|
|
561
|
-
import
|
|
650
|
+
import radia_ngsolve
|
|
562
651
|
|
|
563
652
|
# Create Radia magnet
|
|
564
653
|
magnet = rad.ObjRecMag([0,0,0], [10,10,10], [0,0,1.2])
|
|
565
654
|
|
|
566
655
|
# Create NGSolve CoefficientFunction
|
|
567
|
-
B_cf =
|
|
656
|
+
B_cf = radia_ngsolve.RadiaField(magnet, 'b')
|
|
568
657
|
|
|
569
658
|
# Use in NGSolve mesh
|
|
570
659
|
mesh = Mesh(...)
|
|
@@ -583,7 +672,7 @@ u_axis = [np.cos(angle), np.sin(angle), 0]
|
|
|
583
672
|
v_axis = [-np.sin(angle), np.cos(angle), 0]
|
|
584
673
|
w_axis = [0, 0, 1]
|
|
585
674
|
|
|
586
|
-
B_cf =
|
|
675
|
+
B_cf = radia_ngsolve.RadiaField(
|
|
587
676
|
magnet, 'b',
|
|
588
677
|
origin=origin,
|
|
589
678
|
u_axis=u_axis,
|
|
@@ -607,7 +696,7 @@ for i in range(20):
|
|
|
607
696
|
magnet_array = rad.ObjCnt(elements) # 8000 elements
|
|
608
697
|
|
|
609
698
|
# Use H-matrix for fast evaluation
|
|
610
|
-
B_cf =
|
|
699
|
+
B_cf = radia_ngsolve.RadiaField(magnet_array, 'b', use_hmatrix=True)
|
|
611
700
|
|
|
612
701
|
# Evaluate on large mesh
|
|
613
702
|
mesh = Mesh(...) # Large mesh
|
|
@@ -618,13 +707,13 @@ gf.Set(B_cf) # Fast thanks to H-matrix
|
|
|
618
707
|
**Vector potential with curl**:
|
|
619
708
|
```python
|
|
620
709
|
# Get vector potential A
|
|
621
|
-
A_cf =
|
|
710
|
+
A_cf = radia_ngsolve.RadiaField(magnet, 'a')
|
|
622
711
|
|
|
623
712
|
# Compute B = curl(A)
|
|
624
713
|
B_from_curl = Curl(A_cf)
|
|
625
714
|
|
|
626
715
|
# Compare with direct B
|
|
627
|
-
B_direct =
|
|
716
|
+
B_direct = radia_ngsolve.RadiaField(magnet, 'b')
|
|
628
717
|
|
|
629
718
|
# Should match (within numerical precision)
|
|
630
719
|
```
|
|
@@ -684,6 +773,6 @@ See [`examples/Radia_to_NGSolve_CoefficientFunction_A/README.md`](../examples/Ra
|
|
|
684
773
|
|
|
685
774
|
---
|
|
686
775
|
|
|
687
|
-
**Last Updated**: 2025-11-
|
|
776
|
+
**Last Updated**: 2025-11-27
|
|
688
777
|
**Maintained By**: Radia Development Team
|
|
689
778
|
**License**: LGPL-2.1 (modifications), BSD-style (original RADIA from ESRF)
|