@@ -177,25 +177,25 @@ void hamilt::DFTU<hamilt::OperatorLCAO<TK, TR>>::cal_nlm_all(const Parallel_Orbi
177177 * @brief Contribute DFT+U Hamiltonian to real-space HR matrix
178178 *
179179 * @details This function handles different scenarios based on:
180- * 1. Whether locale (occupation matrix) is read from file (is_locale_initialized )
180+ * 1. Whether locale (occupation matrix) is read from file (is_occ_mat_initialized )
181181 * 2. Spin configuration (nspin=1, 2, or 4)
182182 * 3. SCF iteration stage (first vs subsequent iterations)
183183 *
184- * Case 1: Locale NOT initialized (!is_locale_initialized )
184+ * Case 1: Locale NOT initialized (!is_occ_mat_initialized )
185185 * - First electronic iteration: calculates occupation matrix from density matrix (DMR)
186186 * * Uses get_dmr(current_spin) to get real-space density matrix
187187 * * Accumulates contributions from all atom pairs via cal_occ()
188188 * * Performs MPI reduction to sum occ across processes
189- * * Stores result via set_locale_flat () for use in VU calculation
189+ * * Stores result via set_occ_mat_flat () for use in VU calculation
190190 * * For nspin=1: occ is scaled by 0.5 (since only one spin channel computed)
191191 * - Subsequent iterations: locale is computed fresh each iteration from updated DMR
192192 *
193- * Case 2: Locale IS initialized (is_locale_initialized , i.e., read from dm_onsite.txt file)
193+ * Case 2: Locale IS initialized (is_occ_mat_initialized , i.e., read from dm_onsite.txt file)
194194 * - First electronic iteration: uses pre-read locale directly without DMR calculation
195195 * * Skips DMR-based occ calculation entirely
196196 * * Reads locale from stored data via get_locale()
197197 * * Different indexing for nspin=4 vs nspin=1/2 (see below)
198- * - After first iteration: mark_locale_dirty () is called to force recomputation
198+ * - After first iteration: mark_occ_mat_dirty () is called to force recomputation
199199 *
200200 * Spin configurations:
201201 * nspin=1 (non-spin-polarized):
@@ -206,14 +206,14 @@ void hamilt::DFTU<hamilt::OperatorLCAO<TK, TR>>::cal_nlm_all(const Parallel_Orbi
206206 * nspin=2 (collinear spin-polarized):
207207 * - Two separate spin channels (spin-up: 0, spin-down: 1)
208208 * - current_spin toggles between 0 and 1 across iterations
209- * - mark_locale_dirty () called when current_spin == 1 (last spin)
209+ * - mark_occ_mat_dirty () called when current_spin == 1 (last spin)
210210 * - HR accumulated separately for each spin
211211 *
212212 * nspin=4 (non-collinear/SOC):
213213 * - Single 4x4 Pauli matrix representation per atom
214214 * - occ has 4*(2l+1)^2 elements (spin_fold=4)
215215 * - get_locale uses spin=0, ipol indices for Pauli blocks
216- * - mark_locale_dirty () always called (current_spin check always true)
216+ * - mark_occ_mat_dirty () always called (current_spin check always true)
217217 * - No current_spin toggling (all spins handled simultaneously)
218218 *
219219 * @warning THREAD SAFETY: cal_HR_IJR() updates shared HR matrix entries.
@@ -228,10 +228,10 @@ void hamilt::DFTU<hamilt::OperatorLCAO<TK, TR>>::contributeHR()
228228 ModuleBase::TITLE (" DFTU" , " contributeHR" );
229229 // Early exit conditions:
230230 // - get_dmr(0) == nullptr: DMR not available (typical in first iteration without file input)
231- // - !is_locale_initialized (): locale not read from file AND not yet computed from DMR
231+ // - !is_occ_mat_initialized (): locale not read from file AND not yet computed from DMR
232232 // When both true, skip DFT+U contribution entirely (first iteration, no file input)
233233 const bool dmr_null = (this ->dftu ->get_dmr (0 ) == nullptr );
234- const bool locale_not_init = !this ->dftu ->is_locale_initialized ();
234+ const bool locale_not_init = !this ->dftu ->is_occ_mat_initialized ();
235235
236236 if (dmr_null && locale_not_init)
237237 {
@@ -280,10 +280,10 @@ void hamilt::DFTU<hamilt::OperatorLCAO<TK, TR>>::contributeHR()
280280 // BRANCH 1: Locale NOT initialized (compute from DMR)
281281 // ============================================================
282282 // This branch is taken when:
283- // - is_locale_initialized () == false (no file read or omc != 0)
283+ // - is_occ_mat_initialized () == false (no file read or omc != 0)
284284 // - DMR is available (get_dmr() != nullptr)
285285 // Typical scenario: normal SCF iterations after first step
286- if (!this ->dftu ->is_locale_initialized ())
286+ if (!this ->dftu ->is_occ_mat_initialized ())
287287 {
288288 // TODO: UNSAFE - get_dmr(current_spin) assumes DMR has correct spin indexing.
289289 // For nspin=2, current_spin must be correctly toggled (0 then 1).
@@ -328,13 +328,13 @@ void hamilt::DFTU<hamilt::OperatorLCAO<TK, TR>>::contributeHR()
328328 {
329329 for (auto & v : occ) { v *= 0.5 ; }
330330 }
331- this ->dftu ->set_locale_flat (iat0, target_L, this ->current_spin , occ);
331+ this ->dftu ->set_occ_mat_flat (iat0, target_L, this ->current_spin , occ);
332332 }
333333 // ============================================================
334334 // BRANCH 2: Locale IS initialized (use pre-read data)
335335 // ============================================================
336336 // This branch is taken when:
337- // - is_locale_initialized () == true (locale read from dm_onsite.txt file)
337+ // - is_occ_mat_initialized () == true (locale read from dm_onsite.txt file)
338338 // - OR omc != 0 (occupation matrix control with dm_onsite_ini.txt)
339339 // Typical scenario: first SCF iteration with file input, or restart calculation
340340 else
@@ -346,8 +346,8 @@ void hamilt::DFTU<hamilt::OperatorLCAO<TK, TR>>::contributeHR()
346346 {
347347 // For nspin=4, locale is stored as 4 stacked tlp1^2 blocks
348348 // at offsets 0, tlp1^2, 2*tlp1^2, 3*tlp1^2 for the 4 Pauli channels.
349- // Use get_locale_flat to read the stacked blocks directly
350- this ->dftu ->get_locale_flat (iat0, target_L, occ);
349+ // Use get_occ_mat_flat to read the stacked blocks directly
350+ this ->dftu ->get_occ_mat_flat (iat0, target_L, occ);
351351 }
352352 // nspin=1 or nspin=2: Collinear spin case
353353 // Locale stored separately for each spin channel
@@ -447,7 +447,7 @@ void hamilt::DFTU<hamilt::OperatorLCAO<TK, TR>>::contributeHR()
447447 // TODO: This logic is confusing. Consider explicit variable like `is_last_spin_channel`.
448448 if (this ->current_spin == this ->nspin - 1 || this ->nspin == 4 )
449449 {
450- this ->dftu ->mark_locale_dirty ();
450+ this ->dftu ->mark_occ_mat_dirty ();
451451 }
452452
453453 // 8. Spin channel toggling for nspin=2
0 commit comments