Skip to content

Commit 7a63b55

Browse files
fix errors
1 parent 5a3e7f6 commit 7a63b55

2 files changed

Lines changed: 10 additions & 26 deletions

File tree

cmake/dependencies.cmake

Lines changed: 4 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -8,30 +8,11 @@ set(plog_REPOSITORY
88
# set (adios2_REPOSITORY https://github.com/ornladios/ADIOS2.git CACHE STRING
99
# "ADIOS2 repository")
1010
function(check_internet_connection)
11-
if(OFFLINE STREQUAL "ON")
12-
set(FETCHCONTENT_FULLY_DISCONNECTED
13-
ON
14-
CACHE BOOL "Connection status")
15-
message(STATUS "${Blue}Offline mode.${ColorReset}")
16-
else()
17-
execute_process(
18-
COMMAND ping 8.8.8.8 -c 2
19-
RESULT_VARIABLE NO_CONNECTION
20-
OUTPUT_QUIET)
11+
# 强制进入离线模式
12+
set(FETCHCONTENT_FULLY_DISCONNECTED ON CACHE BOOL "Connection status")
13+
set(OFFLINE ON CACHE BOOL "ON")
2114

22-
if(NO_CONNECTION GREATER 0)
23-
set(FETCHCONTENT_FULLY_DISCONNECTED
24-
ON
25-
CACHE BOOL "Connection status")
26-
message(
27-
STATUS "${Red}No internet connection. Fetching disabled.${ColorReset}")
28-
else()
29-
set(FETCHCONTENT_FULLY_DISCONNECTED
30-
OFF
31-
CACHE BOOL "Connection status")
32-
message(STATUS "${Green}Internet connection established.${ColorReset}")
33-
endif()
34-
endif()
15+
message(STATUS "${Blue}Forced offline mode.${ColorReset}")
3516
endfunction()
3617

3718
function(find_or_fetch_dependency package_name header_only)

src/kernels/ampere_mink.hpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,20 +95,23 @@ namespace kernel::mink {
9595
// coeff = -dt * q0 * n0 / (B0 * V0)
9696
const real_t coeff;
9797
const real_t inv_n0;
98+
const real_t J0;
9899

99100
public:
100101
CurrentsAmpere_kernel(const ndfield_t<D, 6>& E,
101102
const ndfield_t<D, 3> J,
102103
real_t coeff,
103-
real_t inv_n0)
104+
real_t inv_n0,
105+
real_t J0)
104106
: E { E }
105107
, J { J }
106108
, coeff { coeff }
107-
, inv_n0 { inv_n0 } {}
109+
, inv_n0 { inv_n0 }
110+
, J0 { J0 } {}
108111

109112
Inline void operator()(index_t i1) const {
110113
if constexpr (D == Dim::_1D) {
111-
J(i1, cur::jx1) *= inv_n0;
114+
J(i1, cur::jx1) *= inv_n0 - J0;
112115
J(i1, cur::jx2) *= inv_n0;
113116
J(i1, cur::jx3) *= inv_n0;
114117

0 commit comments

Comments
 (0)