Skip to content

Commit e1e365b

Browse files
committed
Tweak inputs and output (#69)
1 parent 9ecea23 commit e1e365b

File tree

3 files changed

+4
-7
lines changed

3 files changed

+4
-7
lines changed

examples/degeus_mechanics/mech.i

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@
9797
# deformation tensor is just forwarded Fnew -> F
9898
forward_buffer = F
9999
forward_buffer_new = Fnew
100-
substeps = 10
100+
substeps = 1
101101
[]
102102

103103
[TensorOutputs]
@@ -117,4 +117,5 @@
117117

118118
[Outputs]
119119
perf_graph = true
120+
console = true
120121
[]

src/tensor_computes/FFTMechanics.C

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,6 @@ FFTMechanics::computeBuffer()
123123
const auto Fn =
124124
at::linalg_norm(_u, c10::nullopt, c10::nullopt, false, c10::nullopt).cpu().item<double>();
125125

126-
unsigned int iiter = 0;
127126
auto dFm = torch::zeros_like(b);
128127

129128
// iterate as long as the iterative update does not vanish
@@ -134,7 +133,7 @@ FFTMechanics::computeBuffer()
134133
dFm = dFm_new;
135134

136135
// update DOFs (array -> tens.grid)
137-
_u = _u + dFm.reshape(_r2_shape);
136+
_u += dFm.reshape(_r2_shape);
138137

139138
// new residual stress and tangent
140139
_constitutive_model.computeBuffer();
@@ -148,13 +147,10 @@ FFTMechanics::computeBuffer()
148147

149148
// print nonlinear residual to the screen
150149
if (_verbose)
151-
_console << "|R|=" << anorm << "\t|R/R0|=" << rnorm << '\n';
152-
std::cout << iiter << " |R|=" << anorm << " vs " << _nl_abs_tol << "\t|R/R0|=" << rnorm
153-
<< " vs " << _nl_rel_tol << '\n';
150+
Moose::out << iiter << " |R|=" << anorm << "\t|R/R0|=" << rnorm << std::endl;
154151

155152
// check convergence
156153
if (rnorm < _nl_rel_tol || anorm < _nl_abs_tol)
157-
// if ((rnorm < _nl_rel_tol || anorm < _nl_abs_tol) && iiter > 0)
158154
return;
159155
}
160156

-42.5 KB
Binary file not shown.

0 commit comments

Comments
 (0)