| 2298 | } |
| 2299 | |
| 2300 | int ASDSteel1DMaterial::commitState(void) |
| 2301 | { |
| 2302 | // implicit stage |
| 2303 | if (params.implex) { |
| 2304 | if (params.buckling) { |
| 2305 | asd_print("MAT commit (" << (int)false << ")"); |
| 2306 | double area = M_PI * params.radius * params.radius; |
| 2307 | bool elastic_correction = params.lch_element > params.length; |
| 2308 | Vector U_expl = elastic_correction && params.auto_regularization ? pdata->rve_m.sv.UG_el : pdata->rve_m.sv.UG; |
| 2309 | double N_expl = N_rve_last; |
| 2310 | double sigma_expl = N_expl / stress; |
| 2311 | |
| 2312 | // implicit solution |
| 2313 | double retval = homogenize(false); |
| 2314 | |
| 2315 | Vector U_impl = elastic_correction && params.auto_regularization ? pdata->rve_m.sv.UG_el : pdata->rve_m.sv.UG; |
| 2316 | double N_impl = N_rve_last; |
| 2317 | double sigma_impl = N_impl / stress; |
| 2318 | |
| 2319 | Vector dU_err = U_expl - U_impl; |
| 2320 | |
| 2321 | // Norm |
| 2322 | double norm_dU = dU_err.Norm(); |
| 2323 | double implex_error_u = norm_dU / params.radius; |
| 2324 | double implex_error_N = (sigma_expl - sigma_impl) / params.sy; |
| 2325 | implex_error = std::max(implex_error_u, implex_error_N); |
| 2326 | GlobalParameters::instance().setMaxError(std::max(implex_error, GlobalParameters::instance().getMaxError())); |
| 2327 | GlobalParameters::instance().accumulateAverageError(implex_error); |
| 2328 | if (retval < 0) return retval; |
| 2329 | } |
| 2330 | else { |
| 2331 | double sigma_expl = stress; |
| 2332 | double sigma_macro = 0.0; |
| 2333 | double tangent_macro = 0.0; |
| 2334 | int retval = pdata->steel_comp.compute(params, false, 1.0, strain, sigma_macro, tangent_macro); |
| 2335 | double sigma_impl = sigma_macro; |
| 2336 | implex_error = std::abs(sigma_expl - sigma_impl) / params.sy; |
| 2337 | GlobalParameters::instance().setMaxError(std::max(implex_error, GlobalParameters::instance().getMaxError())); |
| 2338 | GlobalParameters::instance().accumulateAverageError(implex_error); |
| 2339 | if (retval < 0) return retval; |
| 2340 | } |
| 2341 | |
| 2342 | } |
| 2343 | |
| 2344 | // compute energy |
| 2345 | energy += 0.5 * (stress_commit + stress) * (strain - strain_commit); |
| 2346 | |
| 2347 | // forward to all components |
| 2348 | pdata->rve_m.commitState(); |
| 2349 | pdata->steel_comp.commitState(); |
| 2350 | |
| 2351 | // state variables |
| 2352 | strain_commit = strain; |
| 2353 | stress_commit = stress; |
| 2354 | |
| 2355 | // implex |
| 2356 | dtime_n_commit = dtime_n; |
| 2357 | commit_done = true; |
no test coverage detected