38 if (model.currentStep() == 0) {
39 model.applyInitialCondition();
40 if (model.performOutput())
44 model.setCurrentDt(model.timeStep());
45 model.applyDisplacementBC();
46 model.computeForces();
49 while (model.currentStep() < model.numTimeSteps()) {
50 model.log(std::format(
"{}: Time step: {}, time: {:8.6f}, steps completed = {}%\n",
51 model.d_name, model.currentStep(), model.d_time,
52 float(model.currentStep()) * 100. / model.numTimeSteps()),
53 2, model.d_n % model.d_infoN == 0, 3);
55 const auto t0 = std::chrono::steady_clock::now();
58 model.appendKeyData(
"integrate_compute_time", dt_ms,
true);
59 model.log(std::format(
" Integration time (ms) = {}\n", dt_ms),
60 2, model.d_n % model.d_infoN == 0, 3);
62 if (model.shouldOutput())
67 model.log(std::format(
68 "{}: Total compute time information (s) \n"
69 " {:22s} = {:8.2f} \n"
70 " {:22s} = {:8.2f} \n"
71 " {:22s} = {:8.2f} \n"
72 " {:22s} = {:8.2f} \n"
73 " {:22s} = {:8.2f} \n"
74 " {:22s} = {:8.2f} \n"
75 " {:22s} = {:8.2f} \n"
76 " {:22s} = {:8.0f} \n",
78 "Time integration", model.getKeyData(
"integrate_compute_time") * 1.e-6,
79 "Peridynamics force", model.getKeyData(
"pd_compute_time") * 1.e-6,
80 "Contact force", model.getKeyData(
"contact_compute_time") * 1.e-6,
81 "Search tree update", model.getKeyData(
"tree_compute_time") * 1.e-6,
82 "External force", model.getKeyData(
"extf_compute_time") * 1.e-6,
83 "MPI ghost exchange", model.getKeyData(
"mpi_exchange_time") * 1.e-6,
84 "Contact neigh update",
85 model.getKeyData(
"contact_neigh_update_time") * 1.e-6,
86 "MPI ghost grains", model.getKeyData(
"mpi_ghost_grain_count")));