Skip to content

Commit db76d77

Browse files
committed
little change
1 parent 7316e09 commit db76d77

File tree

3 files changed

+15
-6
lines changed

3 files changed

+15
-6
lines changed

source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/dftu_force_stress.hpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,9 +216,12 @@ void DFTU<OperatorLCAO<TK, TR>>::cal_force_stress(const bool cal_force,
216216
}
217217
#pragma omp critical
218218
{
219-
for(int i = 0; i < 6; i++)
219+
if(cal_stress)
220220
{
221-
stress_tmp[i] += stress_local[i];
221+
for(int i = 0; i < 6; i++)
222+
{
223+
stress_tmp[i] += stress_local[i];
224+
}
222225
}
223226
}
224227
}

source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/dspin_force_stress.hpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,9 +194,12 @@ void DeltaSpin<OperatorLCAO<TK, TR>>::cal_force_stress(const bool cal_force,
194194
}
195195
#pragma omp critical
196196
{
197-
for(int i = 0; i < 6; i++)
197+
if(cal_stress)
198198
{
199-
stress_tmp[i] += stress_local[i];
199+
for(int i = 0; i < 6; i++)
200+
{
201+
stress_tmp[i] += stress_local[i];
202+
}
200203
}
201204
}
202205
}

source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/nonlocal_force_stress.hpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,9 +168,12 @@ void NonlocalNew<OperatorLCAO<TK, TR>>::cal_force_stress(const bool cal_force,
168168
}
169169
#pragma omp critical
170170
{
171-
for(int i = 0; i < 6; i++)
171+
if(cal_stress)
172172
{
173-
stress_tmp[i] += stress_local[i];
173+
for(int i = 0; i < 6; i++)
174+
{
175+
stress_tmp[i] += stress_local[i];
176+
}
174177
}
175178
}
176179
}

0 commit comments

Comments
 (0)