MCPcopy Create free account
hub / github.com/SeisSol/SeisSol / correct

Method correct

src/Solver/time_stepping/TimeCluster.cpp:753–830  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

751}
752
753void TimeCluster::correct() {
754 assert(state == ActorState::Predicted);
755 /* Sub start time of width respect to the next cluster; use 0 if not relevant, for example in GTS.
756 * LTS requires to evaluate a partial time integration of the derivatives. The point zero in time
757 * refers to the derivation of the surrounding time derivatives, which coincides with the last
758 * completed time step of the next cluster. The start/end of the time step is the start/end of
759 * this clusters time step relative to the zero point.
760 * Example:
761 * 5 dt
762 * |-----------------------------------------------------------------------------------------| <<< Time stepping of the next cluster (Cn) (5x larger than the current).
763 * | | | | | |
764 * |*****************|*****************|+++++++++++++++++| | | <<< Status of the current cluster.
765 * | | | | | |
766 * |-----------------|-----------------|-----------------|-----------------|-----------------| <<< Time stepping of the current cluster (Cc).
767 * 0 dt 2dt 3dt 4dt 5dt
768 *
769 * In the example above two clusters are illustrated: Cc and Cn. Cc is the current cluster under consideration and Cn the next cluster with respect to LTS terminology.
770 * Cn is currently at time 0 and provided Cc with derivatives valid until 5dt. Cc updated already twice and did its last full update to reach 2dt (== subTimeStart). Next
771 * computeNeighboringCopy is called to accomplish the next full update to reach 3dt (+++). Besides working on the buffers of own buffers and those of previous clusters,
772 * Cc needs to evaluate the time prediction of Cn in the interval [2dt, 3dt].
773 */
774 double subTimeStart = ct.correctionTime - lastSubTime;
775
776 // Note, if this is a copy layer actor, we need the FL_Copy and the FL_Int.
777 // Otherwise, this is an interior layer actor, and we need only the FL_Int.
778 // We need to avoid computing it twice.
779 if (dynamicRuptureScheduler->hasDynamicRuptureFaces()) {
780 if (dynamicRuptureScheduler->mayComputeInterior(ct.stepsSinceStart)) {
781 handleDynamicRupture(*dynRupInteriorData);
782 seissolInstance.flopCounter().incrementNonZeroFlopsDynamicRupture(m_flops_nonZero[static_cast<int>(ComputePart::DRFrictionLawInterior)]);
783 seissolInstance.flopCounter().incrementHardwareFlopsDynamicRupture(m_flops_hardware[static_cast<int>(ComputePart::DRFrictionLawInterior)]);
784 dynamicRuptureScheduler->setLastCorrectionStepsInterior(ct.stepsSinceStart);
785 }
786 if (layerType == Copy) {
787 handleDynamicRupture(*dynRupCopyData);
788 seissolInstance.flopCounter().incrementNonZeroFlopsDynamicRupture(m_flops_nonZero[static_cast<int>(ComputePart::DRFrictionLawCopy)]);
789 seissolInstance.flopCounter().incrementHardwareFlopsDynamicRupture(m_flops_hardware[static_cast<int>(ComputePart::DRFrictionLawCopy)]);
790 dynamicRuptureScheduler->setLastCorrectionStepsCopy((ct.stepsSinceStart));
791 }
792
793 }
794
795#ifdef ACL_DEVICE
796 if (executor == Executor::Device) {
797 computeNeighboringIntegrationDevice(*m_clusterData, subTimeStart);
798 }
799 else {
800 computeNeighboringIntegration(*m_clusterData, subTimeStart);
801 }
802#else
803 computeNeighboringIntegration(*m_clusterData, subTimeStart);
804#endif
805
806 seissolInstance.flopCounter().incrementNonZeroFlopsNeighbor(m_flops_nonZero[static_cast<int>(ComputePart::Neighbor)]);
807 seissolInstance.flopCounter().incrementHardwareFlopsNeighbor(m_flops_hardware[static_cast<int>(ComputePart::Neighbor)]);
808 seissolInstance.flopCounter().incrementNonZeroFlopsDynamicRupture(m_flops_nonZero[static_cast<int>(ComputePart::DRNeighbor)]);
809 seissolInstance.flopCounter().incrementHardwareFlopsDynamicRupture(m_flops_hardware[static_cast<int>(ComputePart::DRNeighbor)]);
810

Callers

nothing calls this directly

Tested by

no test coverage detected