Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
deltaeecs committed Jul 9, 2024
2 parents 59ab808 + 1924d03 commit 7160715
Show file tree
Hide file tree
Showing 6 changed files with 74 additions and 13 deletions.
22 changes: 13 additions & 9 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,26 @@ CairoMakie = "13f3f980-e62b-5c42-98c6-ff1f3baf88f0"
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
IterativeSolvers = "42fd0dbc-a981-5370-80f2-aaf504508153"
LaTeXStrings = "b964fa9f-0449-5b57-a5c2-d3ea65f4040f"
MPIArray4MoMs = "b7f3fe35-ff1f-4dc5-b861-bd211d5a9a4b"
MoM_Basics = "84796d1e-6a74-43fe-971c-cdafebd16eaa"
MoM_Kernels = "831fc53b-0fa6-4fbb-adc4-fa1e0b19763e"
MoM_MPI = "307724fd-586d-46f6-8b3d-ea3ff22db83d"
MoM_Visualizing = "cbf82f24-4841-4ec9-b0f8-e22c06a1387c"
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
Reexport = "189a3867-3050-52da-a836-e630ba90ab69"

[compat]
CSV = "0.10 - 0.12"
CairoMakie = "0.10 - 0.12"
DataFrames = "1.5 - 1.6"
IterativeSolvers = "0.9 - 0.10"
LaTeXStrings = "1.3 - 1.4"
MoM_Basics = "0.0 - 0.1"
MoM_Kernels = "0.0 - 0.1"
MoM_Visualizing = "0.0 - 0.1"
Reexport = "1.2 - 1.4"
CSV = "0.10 - 0.20"
CairoMakie = "0.10 - 0.30"
DataFrames = "1.5 - 1.20"
IterativeSolvers = "0.9 - 0.20"
LaTeXStrings = "1.3 - 1.20"
MPIArray4MoMs = "0.0.1 - 0.1"
MoM_Basics = "0.1.1 - 0.20"
MoM_Kernels = "0.1 - 0.20"
MoM_MPI = "0.1 - 0.20"
MoM_Visualizing = "0.0.3 - 0.20"
Reexport = "1.2 - 1.20"
julia = "1"

[extras]
Expand Down
2 changes: 1 addition & 1 deletion deps/install.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ using Pkg
Pkg.activate(joinpath(@__DIR__, ".."))

## 安装包
pkgs = ["https://gitee.com/deltaeecs/IterativeSolvers.jl.git",]
pkgs = ["https://github.com/deltaeecs/IterativeSolvers.jl.git",]

map(pkgs) do pkg
try
Expand Down
55 changes: 55 additions & 0 deletions examples/examples_SEFIE_mlfma copy.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
## 导入程序包
using MoM_AllinOne
# using MKL, MKLSparse
using DataFrames, CSV, LaTeXStrings
using CairoMakie, MoM_Visualizing

## 参数设置
# 设置精度,是否运行时出图等
setPrecision!(Float32)
SimulationParams.SHOWIMAGE = true

# 网格文件
filename = joinpath(@__DIR__, "..", "meshfiles/Helicopter_fine.nas")
meshUnit = :m
## 设置输入频率(Hz)从而修改内部参数
frequency = 1e8

# 积分方程类型
ieT = :EFIE

# 更新基函数类型参数(不推荐更改)
sbfT = :RWG
vbfT = :nothing

# 求解器类型
solverT = :gmres

# 设置 gmres 求解器精度,重启步长(步长越大收敛越快但越耗内存)
rtol = 1e-3
restart = 50

#
source = PlaneWave/2, 0, 0f0, 1f0)

## 观测角度
θs_obs = LinRange{Precision.FT}( -π, π, 721)
ϕs_obs = LinRange{Precision.FT}( 0, π/2, 2 )

# 计算脚本
include(joinpath(@__DIR__, "../src/fast_solver.jl"))

## 比较绘图
# 导入feko数据
feko_RCS_file = joinpath(@__DIR__, "../deps/compare_feko/jet_100MHzRCS.csv")
data_feko = DataFrame(CSV.File(feko_RCS_file, delim=' ', ignorerepeated=true))
RCS_feko = reshape(data_feko[!, "in"], :, 2)

# 绘图保存
fig = farfield2D(θs_obs, 10log10.(RCS_feko), 10log10.(RCS),
[L"\text{Feko}\;\quad (\phi = \enspace0^{\circ})", L"\text{Feko}\;\quad (\phi = 90^{\circ})"],
[L"\text{JuMoM} (\phi = \enspace0^{\circ})", L"\text{JuMoM} (\phi = 90^{\circ})"],
xlabel = L"\theta (^{\circ})", ylabel = L"\text{RCS(dBsm)}", x_unit = :rad, legendposition = :lb)
savedir = joinpath(@__DIR__, "..", "figures")
!ispath(savedir) && mkpath(savedir)
save(joinpath(savedir, "SEFIE_RCS_jet_100MHz_fast.pdf"), fig)
2 changes: 1 addition & 1 deletion examples/examples_VEFIE_mlfma.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ using CairoMakie, MoM_Visualizing

## 参数设置
# 设置精度,是否运行时出图等
setPrecision!(Float32)
setPrecision!(Float64)
SimulationParams.SHOWIMAGE = true

# 网格文件
Expand Down
4 changes: 3 additions & 1 deletion src/fast_solver.jl
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ leafLevel = octree.levels[nLevels];
ZnearCSC = calZnearCSC(leafLevel, geosInfo, bfsInfo);

# 构建矩阵向量乘积算子
Zopt = MLMFAIterator(ZnearCSC, octree, geosInfo, bfsInfo);
Zopt = MLFMAIterator(ZnearCSC, octree, geosInfo, bfsInfo);

## 根据近场矩阵和八叉树计算 SAI 左预条件
Zprel = sparseApproximateInversePl(ZnearCSC, leafLevel)
Expand All @@ -35,5 +35,7 @@ V = getExcitationVector(geosInfo, nbf, source);
# 求解
ICoeff, ch = solve(Zopt, V; solverT = solverT, Pl = Zprel, rtol = rtol, restart = restart);

using LinearAlgebra
@info norm(ZnearCSC) norm(V)
# RCS
RCSθsϕs, RCSθsϕsdB, RCS, RCSdB = radarCrossSection(θs_obs, ϕs_obs, ICoeff, geosInfo)
2 changes: 1 addition & 1 deletion src/fast_solver_ilu.jl
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ leafLevel = octree.levels[nLevels];
ZnearCSC = calZnearCSC(leafLevel, geosInfo, bfsInfo);

# 构建矩阵向量乘积算子
Zopt = MLMFAIterator(ZnearCSC, octree, geosInfo, bfsInfo);
Zopt = MLFMAIterator(ZnearCSC, octree, geosInfo, bfsInfo);

## 根据近场矩阵和八叉树计算 SAI 左预条件
Zprel = ilu(sparse(ZnearCSC); τ = 1e-3);#sparseApproximateInversePl(ZnearCSC, leafLevel)
Expand Down

0 comments on commit 7160715

Please sign in to comment.