radia 1.3.4__tar.gz → 1.3.5__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.4/src/radia.egg-info → radia-1.3.5}/PKG-INFO +1 -1
- radia-1.3.5/examples/magnets/README_NGSOLVE_REFERENCE.md +180 -0
- radia-1.3.5/examples/magnets/cube_ngsolve_reference_with_Kelvin.py +550 -0
- radia-1.3.5/examples/magnets/cube_radia_comparison.py +246 -0
- radia-1.3.5/examples/magnets/cube_radia_tetra_comparison.py +273 -0
- {radia-1.3.4 → radia-1.3.5}/pyproject.toml +1 -1
- {radia-1.3.4 → radia-1.3.5/radia.egg-info}/PKG-INFO +1 -1
- {radia-1.3.4/src → radia-1.3.5}/radia.egg-info/SOURCES.txt +11 -12
- radia-1.3.5/radia.egg-info/top_level.txt +1 -0
- {radia-1.3.4 → radia-1.3.5}/setup.py +5 -7
- radia-1.3.5/src/python/__init__.py +2 -0
- radia-1.3.5/src/python/radia_tetra_mesh.py +657 -0
- radia-1.3.4/src/python/__init__.py +0 -2
- radia-1.3.4/src/radia.egg-info/top_level.txt +0 -1
- {radia-1.3.4 → radia-1.3.5}/COPYRIGHT.txt +0 -0
- {radia-1.3.4 → radia-1.3.5}/LICENSE +0 -0
- {radia-1.3.4 → radia-1.3.5}/MANIFEST.in +0 -0
- {radia-1.3.4 → radia-1.3.5}/README.md +0 -0
- {radia-1.3.4 → radia-1.3.5}/docs/API_EXTENSIONS.md +0 -0
- {radia-1.3.4 → radia-1.3.5}/docs/API_REFERENCE.md +0 -0
- {radia-1.3.4 → radia-1.3.5}/docs/CF_BACKGROUND_FIELD_IMPLEMENTATION.md +0 -0
- {radia-1.3.4 → radia-1.3.5}/docs/HMATRIX_BENCHMARKS_RESULTS.md +0 -0
- {radia-1.3.4 → radia-1.3.5}/docs/HMATRIX_ENHANCEMENT_PROPOSAL_2025.md +0 -0
- {radia-1.3.4 → radia-1.3.5}/docs/HMATRIX_IMPLEMENTATION_HISTORY.md +0 -0
- {radia-1.3.4 → radia-1.3.5}/docs/HMATRIX_SERIALIZATION.md +0 -0
- {radia-1.3.4 → radia-1.3.5}/docs/HMATRIX_USER_GUIDE.md +0 -0
- {radia-1.3.4 → radia-1.3.5}/docs/MATERIAL_API_IMPLEMENTATION.md +0 -0
- {radia-1.3.4 → radia-1.3.5}/docs/ML_PARAMETER_TUNING.md +0 -0
- {radia-1.3.4 → radia-1.3.5}/docs/NGSOLVE_CF_BACKGROUND_FIELD_DESIGN.md +0 -0
- {radia-1.3.4 → radia-1.3.5}/docs/NGSOLVE_INTEGRATION.md +0 -0
- {radia-1.3.4 → radia-1.3.5}/docs/NGSOLVE_USAGE_GUIDE.md +0 -0
- {radia-1.3.4 → radia-1.3.5}/docs/README.md +0 -0
- {radia-1.3.4 → radia-1.3.5}/docs/hmatrix_field_design.md +0 -0
- {radia-1.3.4 → radia-1.3.5}/docs/scripts/README.md +0 -0
- {radia-1.3.4 → radia-1.3.5}/examples/README.md +0 -0
- {radia-1.3.4 → radia-1.3.5}/examples/background_fields/README.md +0 -0
- {radia-1.3.4 → radia-1.3.5}/examples/background_fields/cubit_to_nastran.py +0 -0
- {radia-1.3.4 → radia-1.3.5}/examples/background_fields/permeability_comparison.py +0 -0
- {radia-1.3.4 → radia-1.3.5}/examples/background_fields/quadrupole_analytical.py +0 -0
- {radia-1.3.4 → radia-1.3.5}/examples/background_fields/quadrupole_analytical.vtk.vtk +0 -0
- {radia-1.3.4 → radia-1.3.5}/examples/background_fields/sphere_in_quadrupole.py +0 -0
- {radia-1.3.4 → radia-1.3.5}/examples/background_fields/sphere_nastran_analysis.py +0 -0
- {radia-1.3.4 → radia-1.3.5}/examples/background_fields/sphere_nastran_field_mu.pvsm +0 -0
- {radia-1.3.4 → radia-1.3.5}/examples/background_fields/sphere_nastran_geometry.vtk +0 -0
- {radia-1.3.4 → radia-1.3.5}/examples/complex_coil_geometry/README.md +0 -0
- {radia-1.3.4 → radia-1.3.5}/examples/complex_coil_geometry/coil_geometry.vtk +0 -0
- {radia-1.3.4 → radia-1.3.5}/examples/complex_coil_geometry/coil_model.py +0 -0
- {radia-1.3.4 → radia-1.3.5}/examples/complex_coil_geometry/complex_coil.pvsm +0 -0
- {radia-1.3.4 → radia-1.3.5}/examples/complex_coil_geometry/field_map.py +0 -0
- {radia-1.3.4 → radia-1.3.5}/examples/complex_coil_geometry/field_map.vtk +0 -0
- {radia-1.3.4 → radia-1.3.5}/examples/complex_coil_geometry/visualize_coils.py +0 -0
- {radia-1.3.4 → radia-1.3.5}/examples/electromagnet/README.md +0 -0
- {radia-1.3.4 → radia-1.3.5}/examples/electromagnet/Radia_model.vtk +0 -0
- {radia-1.3.4 → radia-1.3.5}/examples/electromagnet/York.vtk +0 -0
- {radia-1.3.4 → radia-1.3.5}/examples/electromagnet/field_distribution.vtk +0 -0
- {radia-1.3.4 → radia-1.3.5}/examples/electromagnet/main_simulation_workflow.py +0 -0
- {radia-1.3.4 → radia-1.3.5}/examples/electromagnet/visualize_paraview.py +0 -0
- {radia-1.3.4 → radia-1.3.5}/examples/electromagnet/york_cubit_mesh.py +0 -0
- {radia-1.3.4 → radia-1.3.5}/examples/magnets/README_CUBE_BENCHMARK.md +0 -0
- {radia-1.3.4 → radia-1.3.5}/examples/magnets/cube_benchmark_external_field.py +0 -0
- {radia-1.3.4 → radia-1.3.5}/examples/magnets/cube_benchmark_radia.vtk +0 -0
- {radia-1.3.4/examples/NGSolve_Integration → radia-1.3.5/examples/ngsolve_integration}/README.md +0 -0
- {radia-1.3.4/examples/NGSolve_Integration → radia-1.3.5/examples/ngsolve_integration}/benchmark_gridfunction_set.py +0 -0
- {radia-1.3.4/examples/NGSolve_Integration → radia-1.3.5/examples/ngsolve_integration}/demo_batch_evaluation.py +0 -0
- {radia-1.3.4/examples/NGSolve_Integration → radia-1.3.5/examples/ngsolve_integration}/demo_field_types.py +0 -0
- {radia-1.3.4/examples/NGSolve_Integration → radia-1.3.5/examples/ngsolve_integration}/example_hmatrix_cache_usage.py +0 -0
- {radia-1.3.4/examples/NGSolve_Integration → radia-1.3.5/examples/ngsolve_integration}/mesh_magnetization_import/RADIA_TETRA_ROOT_CAUSE.md +0 -0
- {radia-1.3.4/examples/NGSolve_Integration → radia-1.3.5/examples/ngsolve_integration}/mesh_magnetization_import/README.md +0 -0
- {radia-1.3.4/examples/NGSolve_Integration → radia-1.3.5/examples/ngsolve_integration}/mesh_magnetization_import/compare_radia_ngsolve_cube.py +0 -0
- {radia-1.3.4/examples/NGSolve_Integration → radia-1.3.5/examples/ngsolve_integration}/mesh_magnetization_import/cube_hex.vtk +0 -0
- {radia-1.3.4/examples/NGSolve_Integration → radia-1.3.5/examples/ngsolve_integration}/mesh_magnetization_import/demo_tetrahedral_methods_comparison.py +0 -0
- {radia-1.3.4/examples/NGSolve_Integration → radia-1.3.5/examples/ngsolve_integration}/mesh_magnetization_import/ngsolve_cube_graded_mesh.vtk +0 -0
- {radia-1.3.4/examples/NGSolve_Integration → radia-1.3.5/examples/ngsolve_integration}/mesh_magnetization_import/ngsolve_cube_uniform_field.py +0 -0
- {radia-1.3.4/examples/NGSolve_Integration → radia-1.3.5/examples/ngsolve_integration}/mesh_magnetization_import/ngsolve_tet_mesh.vtk +0 -0
- {radia-1.3.4/examples/NGSolve_Integration → radia-1.3.5/examples/ngsolve_integration}/mesh_magnetization_import/sphere_domain_graded_mesh.vtk +0 -0
- {radia-1.3.4/examples/NGSolve_Integration → radia-1.3.5/examples/ngsolve_integration}/test_batch_evaluation.py +0 -0
- {radia-1.3.4/examples/NGSolve_Integration → radia-1.3.5/examples/ngsolve_integration}/verify_curl_A_equals_B.py +0 -0
- {radia-1.3.4/examples/NGSolve_Integration → radia-1.3.5/examples/ngsolve_integration}/visualize_field.py +0 -0
- {radia-1.3.4 → radia-1.3.5}/examples/simple_problems/CONVERSION_NOTES.md +0 -0
- {radia-1.3.4 → radia-1.3.5}/examples/simple_problems/README.md +0 -0
- {radia-1.3.4 → radia-1.3.5}/examples/simple_problems/arc_current_dual_magnets.py +0 -0
- {radia-1.3.4 → radia-1.3.5}/examples/simple_problems/arc_current_with_magnet.py +0 -0
- {radia-1.3.4 → radia-1.3.5}/examples/simple_problems/chamfered_pole_piece.py +0 -0
- {radia-1.3.4 → radia-1.3.5}/examples/simple_problems/compare_magpylib.py +0 -0
- {radia-1.3.4 → radia-1.3.5}/examples/simple_problems/cubic_polyhedron_magnet.py +0 -0
- {radia-1.3.4 → radia-1.3.5}/examples/simple_problems/hmatrix_update_magnetization.py +0 -0
- {radia-1.3.4 → radia-1.3.5}/examples/smco_magnet_array/README.md +0 -0
- {radia-1.3.4 → radia-1.3.5}/examples/smco_magnet_array/smbo.pvsm +0 -0
- {radia-1.3.4 → radia-1.3.5}/examples/smco_magnet_array/smco_array.py +0 -0
- {radia-1.3.4 → radia-1.3.5}/examples/smco_magnet_array/smco_array.vtk +0 -0
- {radia-1.3.4 → radia-1.3.5}/examples/smco_magnet_array/smco_field_distribution.vtk +0 -0
- {radia-1.3.4 → radia-1.3.5}/examples/solver_benchmarks/BENCHMARK_RESULTS.md +0 -0
- {radia-1.3.4 → radia-1.3.5}/examples/solver_benchmarks/HMATRIX_FIELD_DESIGN.md +0 -0
- {radia-1.3.4 → radia-1.3.5}/examples/solver_benchmarks/HMATRIX_FIELD_DESIGN_SIMPLIFIED.md +0 -0
- {radia-1.3.4 → radia-1.3.5}/examples/solver_benchmarks/PHASE2B_REEVALUATION.md +0 -0
- {radia-1.3.4 → radia-1.3.5}/examples/solver_benchmarks/README.md +0 -0
- {radia-1.3.4 → radia-1.3.5}/examples/solver_benchmarks/SCALING_RESULTS.md +0 -0
- {radia-1.3.4 → radia-1.3.5}/examples/solver_benchmarks/benchmark_field_evaluation.py +0 -0
- {radia-1.3.4 → radia-1.3.5}/examples/solver_benchmarks/benchmark_hmatrix_field.py +0 -0
- {radia-1.3.4 → radia-1.3.5}/examples/solver_benchmarks/benchmark_hmatrix_scaling_exact.py +0 -0
- {radia-1.3.4 → radia-1.3.5}/examples/solver_benchmarks/benchmark_large_scale_comparison.py +0 -0
- {radia-1.3.4 → radia-1.3.5}/examples/solver_benchmarks/benchmark_linear_material.py +0 -0
- {radia-1.3.4 → radia-1.3.5}/examples/solver_benchmarks/benchmark_matrix_construction.py +0 -0
- {radia-1.3.4 → radia-1.3.5}/examples/solver_benchmarks/benchmark_parallel_construction.py +0 -0
- {radia-1.3.4 → radia-1.3.5}/examples/solver_benchmarks/benchmark_solver.py +0 -0
- {radia-1.3.4 → radia-1.3.5}/examples/solver_benchmarks/benchmark_solver_comparison.py +0 -0
- {radia-1.3.4 → radia-1.3.5}/examples/solver_benchmarks/benchmark_solver_methods.py +0 -0
- {radia-1.3.4 → radia-1.3.5}/examples/solver_benchmarks/benchmark_solver_scaling.py +0 -0
- {radia-1.3.4 → radia-1.3.5}/examples/solver_benchmarks/benchmark_solver_scaling_extended.py +0 -0
- {radia-1.3.4 → radia-1.3.5}/examples/solver_benchmarks/plot_benchmark_results.py +0 -0
- {radia-1.3.4 → radia-1.3.5}/examples/solver_benchmarks/run_all_benchmarks.py +0 -0
- {radia-1.3.4 → radia-1.3.5}/examples/solver_benchmarks/run_all_hmatrix_benchmarks.py +0 -0
- {radia-1.3.4 → radia-1.3.5}/examples/solver_benchmarks/verify_field_accuracy.py +0 -0
- {radia-1.3.4/src → radia-1.3.5}/radia.egg-info/dependency_links.txt +0 -0
- {radia-1.3.4/src → radia-1.3.5}/radia.egg-info/not-zip-safe +0 -0
- {radia-1.3.4/src → radia-1.3.5}/radia.egg-info/requires.txt +0 -0
- {radia-1.3.4 → radia-1.3.5}/setup.cfg +0 -0
- {radia-1.3.4 → radia-1.3.5}/src/python/nastran_mesh_import.py +0 -0
- {radia-1.3.4 → radia-1.3.5}/src/python/netgen_mesh_import.py +0 -0
- {radia-1.3.4 → radia-1.3.5}/src/python/rad_ngsolve.pyd +0 -0
- {radia-1.3.4 → radia-1.3.5}/src/python/rad_ngsolve_fast.py +0 -0
- {radia-1.3.4 → radia-1.3.5}/src/python/radia_coil_builder.py +0 -0
- {radia-1.3.4 → radia-1.3.5}/src/python/radia_field_cached.py +0 -0
- {radia-1.3.4 → radia-1.3.5}/src/python/radia_ngsolve.pyd +0 -0
- {radia-1.3.4 → radia-1.3.5}/src/python/radia_ngsolve_field.py +0 -0
- {radia-1.3.4 → radia-1.3.5}/src/python/radia_ngsolve_utils.py +0 -0
- {radia-1.3.4 → radia-1.3.5}/src/python/radia_pyvista_viewer.py +0 -0
- {radia-1.3.4 → radia-1.3.5}/src/python/radia_vtk_export.py +0 -0
- {radia-1.3.4 → radia-1.3.5}/tests/README.md +0 -0
- {radia-1.3.4 → radia-1.3.5}/tests/__init__.py +0 -0
- {radia-1.3.4 → radia-1.3.5}/tests/benchmark_hmatrix.py +0 -0
- {radia-1.3.4 → radia-1.3.5}/tests/benchmarks/benchmark_correct.py +0 -0
- {radia-1.3.4 → radia-1.3.5}/tests/benchmarks/benchmark_heavy.py +0 -0
- {radia-1.3.4 → radia-1.3.5}/tests/benchmarks/benchmark_openmp.py +0 -0
- {radia-1.3.4 → radia-1.3.5}/tests/benchmarks/benchmark_threads.py +0 -0
- {radia-1.3.4 → radia-1.3.5}/tests/conftest.py +0 -0
- {radia-1.3.4 → radia-1.3.5}/tests/hmatrix/test_phase2a_final.py +0 -0
- {radia-1.3.4 → radia-1.3.5}/tests/hmatrix/test_phase2a_hmatrix_reuse.py +0 -0
- {radia-1.3.4 → radia-1.3.5}/tests/hmatrix/test_phase2a_with_field.py +0 -0
- {radia-1.3.4 → radia-1.3.5}/tests/hmatrix/test_phase2b_geometry_detection.py +0 -0
- {radia-1.3.4 → radia-1.3.5}/tests/hmatrix/test_phase3_magnetization_update.py +0 -0
- {radia-1.3.4 → radia-1.3.5}/tests/hmatrix/test_phase3b_large_problem.py +0 -0
- {radia-1.3.4 → radia-1.3.5}/tests/hmatrix/test_phase3b_serialization.py +0 -0
- {radia-1.3.4 → radia-1.3.5}/tests/hmatrix/test_phase3b_solver_cache.py +0 -0
- {radia-1.3.4 → radia-1.3.5}/tests/hmatrix/test_serialize_step1_build.py +0 -0
- {radia-1.3.4 → radia-1.3.5}/tests/hmatrix/test_serialize_step2_load.py +0 -0
- {radia-1.3.4 → radia-1.3.5}/tests/hmatrix/test_verify_field_simple.py +0 -0
- {radia-1.3.4 → radia-1.3.5}/tests/profile_batch_performance.py +0 -0
- {radia-1.3.4 → radia-1.3.5}/tests/test_advanced.py +0 -0
- {radia-1.3.4 → radia-1.3.5}/tests/test_all_spaces.py +0 -0
- {radia-1.3.4 → radia-1.3.5}/tests/test_background_field_debug.py +0 -0
- {radia-1.3.4 → radia-1.3.5}/tests/test_batch_evaluation.py +0 -0
- {radia-1.3.4 → radia-1.3.5}/tests/test_cf_direct.py +0 -0
- {radia-1.3.4 → radia-1.3.5}/tests/test_convergence_hdiv.py +0 -0
- {radia-1.3.4 → radia-1.3.5}/tests/test_curlA_equals_B.py +0 -0
- {radia-1.3.4 → radia-1.3.5}/tests/test_curl_A_detailed.py +0 -0
- {radia-1.3.4 → radia-1.3.5}/tests/test_far_field_accuracy.py +0 -0
- {radia-1.3.4 → radia-1.3.5}/tests/test_fast_preparecache.py +0 -0
- {radia-1.3.4 → radia-1.3.5}/tests/test_fast_simple.py +0 -0
- {radia-1.3.4 → radia-1.3.5}/tests/test_group_operations.py +0 -0
- {radia-1.3.4 → radia-1.3.5}/tests/test_hcurl_vs_hdiv.py +0 -0
- {radia-1.3.4 → radia-1.3.5}/tests/test_hmatrix_cache.py +0 -0
- {radia-1.3.4 → radia-1.3.5}/tests/test_hmatrix_cache_simple.py +0 -0
- {radia-1.3.4 → radia-1.3.5}/tests/test_l2_norm_debug.py +0 -0
- {radia-1.3.4 → radia-1.3.5}/tests/test_magpylib_comparison.py +0 -0
- {radia-1.3.4 → radia-1.3.5}/tests/test_materials.py +0 -0
- {radia-1.3.4 → radia-1.3.5}/tests/test_memory_allocation_tracking.py +0 -0
- {radia-1.3.4 → radia-1.3.5}/tests/test_minimal_cached.py +0 -0
- {radia-1.3.4 → radia-1.3.5}/tests/test_moving_magnet_memory.py +0 -0
- {radia-1.3.4 → radia-1.3.5}/tests/test_moving_magnet_memory_diagnosis.py +0 -0
- {radia-1.3.4 → radia-1.3.5}/tests/test_new_material_api.py +0 -0
- {radia-1.3.4 → radia-1.3.5}/tests/test_objbckg_simple.py +0 -0
- {radia-1.3.4 → radia-1.3.5}/tests/test_objbckgcf_alone.py +0 -0
- {radia-1.3.4 → radia-1.3.5}/tests/test_order1.py +0 -0
- {radia-1.3.4 → radia-1.3.5}/tests/test_parallel_performance.py +0 -0
- {radia-1.3.4 → radia-1.3.5}/tests/test_preparecache_performance.py +0 -0
- {radia-1.3.4 → radia-1.3.5}/tests/test_process_memory.py +0 -0
- {radia-1.3.4 → radia-1.3.5}/tests/test_python_cached_field.py +0 -0
- {radia-1.3.4 → radia-1.3.5}/tests/test_python_cached_simple.py +0 -0
- {radia-1.3.4 → radia-1.3.5}/tests/test_rad_ngsolve.py +0 -0
- {radia-1.3.4 → radia-1.3.5}/tests/test_rad_ngsolve_diagnostic.py +0 -0
- {radia-1.3.4 → radia-1.3.5}/tests/test_rad_ngsolve_function.py +0 -0
- {radia-1.3.4 → radia-1.3.5}/tests/test_rad_ngsolve_hmatrix.py +0 -0
- {radia-1.3.4 → radia-1.3.5}/tests/test_radhmat.py +0 -0
- {radia-1.3.4 → radia-1.3.5}/tests/test_radia.py +0 -0
- {radia-1.3.4 → radia-1.3.5}/tests/test_radia_core_memory.py +0 -0
- {radia-1.3.4 → radia-1.3.5}/tests/test_radia_field_computation_memory.py +0 -0
- {radia-1.3.4 → radia-1.3.5}/tests/test_radia_ngsolve_longrun.py +0 -0
- {radia-1.3.4 → radia-1.3.5}/tests/test_radia_ngsolve_memory_leak.py +0 -0
- {radia-1.3.4 → radia-1.3.5}/tests/test_radia_ngsolve_with_cache.py +0 -0
- {radia-1.3.4 → radia-1.3.5}/tests/test_radia_only_memory.py +0 -0
- {radia-1.3.4 → radia-1.3.5}/tests/test_serialization.py +0 -0
- {radia-1.3.4 → radia-1.3.5}/tests/test_set_vs_interpolate.py +0 -0
- {radia-1.3.4 → radia-1.3.5}/tests/test_simple.py +0 -0
- {radia-1.3.4 → radia-1.3.5}/tests/test_simple_fld_leak.py +0 -0
- {radia-1.3.4 → radia-1.3.5}/tests/test_square_coil_analytical.py +0 -0
- {radia-1.3.4 → radia-1.3.5}/tests/test_tetrahedral_solver.py +0 -0
- {radia-1.3.4 → radia-1.3.5}/tests/test_transformations.py +0 -0
- {radia-1.3.4 → radia-1.3.5}/tests/test_type_cast.py +0 -0
- {radia-1.3.4 → radia-1.3.5}/tests/test_unit_conversion_verify.py +0 -0
- {radia-1.3.4 → radia-1.3.5}/tests/test_update_hmatrix_magnetization.py +0 -0
- {radia-1.3.4 → radia-1.3.5}/tests/test_utils.py +0 -0
- {radia-1.3.4 → radia-1.3.5}/tests/test_vector_potential.py +0 -0
- {radia-1.3.4 → radia-1.3.5}/tests/test_without_B_projection.py +0 -0
- {radia-1.3.4 → radia-1.3.5}/tests/test_without_gridfunction.py +0 -0
- {radia-1.3.4 → radia-1.3.5}/tests/verify_curl_A_equals_B.py +0 -0
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
# NGSolve Reference Solutions for Radia Validation
|
|
2
|
+
|
|
3
|
+
This document explains how to generate high-accuracy NGSolve reference solutions for validating and debugging Radia's tetrahedral solver.
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
The NGSolve reference solutions use **H-formulation with Kelvin transformation** to solve magnetostatic problems with high accuracy. The Kelvin transformation handles the infinite domain problem without truncation errors, making these solutions suitable as ground truth for Radia validation.
|
|
8
|
+
|
|
9
|
+
## Status
|
|
10
|
+
|
|
11
|
+
**Current Implementation**: The Kelvin transformation implementation is based on the sphere reference at `S:/NGSolve/NGSolve/2024_01_31_H-formulation/2025_11_22_H-formulation3D_dipole_with_Kelvin.py`. The original sphere script also shows some numerical issues with the Kelvin transformation coupling. The cube version inherits these issues.
|
|
12
|
+
|
|
13
|
+
**For Reference Documentation**: See `S:/NGSolve/NGSolve/2024_01_31_H-formulation/Kelvin_3d.md` for the complete mathematical theory of 3D Kelvin transformation in magnetostatics.
|
|
14
|
+
|
|
15
|
+
## Available Scripts
|
|
16
|
+
|
|
17
|
+
| Script | Geometry | Description |
|
|
18
|
+
|--------|----------|-------------|
|
|
19
|
+
| `cube_ngsolve_reference_with_Kelvin.py` | Cube | Cube in uniform external field with mu_r=100 |
|
|
20
|
+
|
|
21
|
+
## Key Features
|
|
22
|
+
|
|
23
|
+
### 1. H-Formulation with Perturbation Potential
|
|
24
|
+
|
|
25
|
+
The formulation solves for the perturbation potential phi where:
|
|
26
|
+
- Total field: **H_total = H_s + H_pert**
|
|
27
|
+
- H_s: Applied background field (uniform field)
|
|
28
|
+
- H_pert = -grad(phi): Perturbation due to magnetic material
|
|
29
|
+
|
|
30
|
+
### 2. Kelvin Transformation
|
|
31
|
+
|
|
32
|
+
The Kelvin transformation maps the infinite exterior domain (r > R) to a finite domain (r' < R):
|
|
33
|
+
- Interior domain: 0 < r < R (original coordinates)
|
|
34
|
+
- Exterior domain: 0 < r' < R (transformed coordinates)
|
|
35
|
+
- Mapping: r' = R^2/r
|
|
36
|
+
|
|
37
|
+
This eliminates truncation errors from finite boundary conditions.
|
|
38
|
+
|
|
39
|
+
### 3. Periodic Boundary Conditions
|
|
40
|
+
|
|
41
|
+
The interior and exterior domains are connected via periodic BC at r = R:
|
|
42
|
+
- Ensures continuity of tangential H field
|
|
43
|
+
- Proper handling of normal B field
|
|
44
|
+
|
|
45
|
+
## Usage
|
|
46
|
+
|
|
47
|
+
### Prerequisites
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
# NGSolve must be installed
|
|
51
|
+
pip install ngsolve
|
|
52
|
+
# or use conda
|
|
53
|
+
conda install -c ngsolve ngsolve
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
### Running the Script
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
cd S:\Radia\01_GitHub\examples\magnets
|
|
60
|
+
python cube_ngsolve_reference_with_Kelvin.py
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
### Output Files
|
|
64
|
+
|
|
65
|
+
| File | Description |
|
|
66
|
+
|------|-------------|
|
|
67
|
+
| `cube_ngsolve_reference_with_Kelvin_permeability.vtu` | VTK file with mu, H_s, phi_pert, H_pert |
|
|
68
|
+
| `cube_ngsolve_reference_with_Kelvin.png` | Visualization plots |
|
|
69
|
+
|
|
70
|
+
### VTK Field Contents
|
|
71
|
+
|
|
72
|
+
**cube_ngsolve_reference_with_Kelvin_permeability.vtu**:
|
|
73
|
+
- `mu`: Permeability distribution [H/m]
|
|
74
|
+
- `Hs`: Background field [A/m]
|
|
75
|
+
- `phi_pert`: Perturbation potential [A]
|
|
76
|
+
- `H_pert`: Perturbation field [A/m]
|
|
77
|
+
|
|
78
|
+
## Configurable Parameters
|
|
79
|
+
|
|
80
|
+
Edit the following parameters in `cube_ngsolve_reference_with_Kelvin.py`:
|
|
81
|
+
|
|
82
|
+
```python
|
|
83
|
+
cube_size = 0.5 # Cube half-size [m] (full cube is 2*cube_size)
|
|
84
|
+
kelvin_radius = 2.0 # Kelvin transformation radius [m]
|
|
85
|
+
maxh_fine = 0.15 # Fine mesh size [m]
|
|
86
|
+
maxh_coarse = 0.3 # Coarse mesh size for outer region [m]
|
|
87
|
+
mu_r = 100 # Relative permeability
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
## Comparing with Radia
|
|
91
|
+
|
|
92
|
+
### Step 1: Generate NGSolve Reference
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
python cube_ngsolve_reference_with_Kelvin.py
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
### Step 2: Run Radia Simulation
|
|
99
|
+
|
|
100
|
+
```python
|
|
101
|
+
import radia as rad
|
|
102
|
+
rad.FldUnits('m') # IMPORTANT: Use meters for NGSolve compatibility
|
|
103
|
+
|
|
104
|
+
# Create cube with same dimensions
|
|
105
|
+
cube = rad.ObjRecMag([0, 0, 0], [1.0, 1.0, 1.0], [0, 0, 0]) # 1m cube
|
|
106
|
+
|
|
107
|
+
# Apply linear material (mu_r = 100)
|
|
108
|
+
mat = rad.MatLin(99.0) # chi = mu_r - 1
|
|
109
|
+
rad.MatApl(cube, mat)
|
|
110
|
+
|
|
111
|
+
# Solve
|
|
112
|
+
rad.Solve(cube, 0.0001, 10000)
|
|
113
|
+
|
|
114
|
+
# Evaluate field at same points as NGSolve
|
|
115
|
+
H_radia = rad.Fld(cube, 'h', [0, 0, 0]) # Field at center
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
### Step 3: Compare Results
|
|
119
|
+
|
|
120
|
+
Load both VTK files in ParaView and compare:
|
|
121
|
+
1. Field values at center
|
|
122
|
+
2. Field profiles along axes
|
|
123
|
+
3. Field distribution in x-z plane
|
|
124
|
+
|
|
125
|
+
## Theoretical Background
|
|
126
|
+
|
|
127
|
+
### Problem Setup
|
|
128
|
+
|
|
129
|
+
A magnetic cube (mu_r = 100) is placed in a uniform external field H_0 = (0, 0, 1) A/m.
|
|
130
|
+
|
|
131
|
+
### Expected Behavior
|
|
132
|
+
|
|
133
|
+
- Inside cube: H field is reduced due to demagnetization
|
|
134
|
+
- Outside cube: Dipole-like perturbation field
|
|
135
|
+
- B = mu_r * mu_0 * H inside the material
|
|
136
|
+
|
|
137
|
+
### Demagnetization Factor
|
|
138
|
+
|
|
139
|
+
For a sphere, the analytical demagnetization factor is N = 1/3, giving:
|
|
140
|
+
```
|
|
141
|
+
H_inside = H_0 / (1 + (mu_r - 1) * N) = H_0 * 3 / (mu_r + 2)
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
For a cube, there is no analytical solution, hence the need for numerical reference.
|
|
145
|
+
|
|
146
|
+
## Troubleshooting
|
|
147
|
+
|
|
148
|
+
### Import Error: No module named 'ngsolve'
|
|
149
|
+
|
|
150
|
+
Install NGSolve:
|
|
151
|
+
```bash
|
|
152
|
+
pip install ngsolve
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
### Mesh Generation Fails
|
|
156
|
+
|
|
157
|
+
Try adjusting mesh parameters:
|
|
158
|
+
```python
|
|
159
|
+
maxh_fine = 0.2 # Increase if mesh fails
|
|
160
|
+
maxh_coarse = 0.4
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
### Solution Does Not Converge
|
|
164
|
+
|
|
165
|
+
Increase solver iterations:
|
|
166
|
+
```python
|
|
167
|
+
solvers.CG(..., maxsteps=20000)
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
## References
|
|
171
|
+
|
|
172
|
+
- [NGSolve Documentation](https://ngsolve.org/)
|
|
173
|
+
- [Kelvin Transformation in Magnetostatics](https://doi.org/10.1109/TMAG.2008.2002395)
|
|
174
|
+
- Original sphere implementation: `S:/NGSolve/NGSolve/2024_01_31_H-formulation/2025_11_22_H-formulation3D_dipole_with_Kelvin.py`
|
|
175
|
+
|
|
176
|
+
## Version History
|
|
177
|
+
|
|
178
|
+
| Date | Description |
|
|
179
|
+
|------|-------------|
|
|
180
|
+
| 2025-11-27 | Initial cube reference solution |
|