VPTissue Reference Manual
TimeSlicer.cpp
Go to the documentation of this file.
1 /*
2  * Copyright 2011-2016 Universiteit Antwerpen
3  *
4  * Licensed under the EUPL, Version 1.1 or as soon they will be approved by
5  * the European Commission - subsequent versions of the EUPL (the "Licence");
6  * You may not use this work except in compliance with the Licence.
7  * You may obtain a copy of the Licence at: http://ec.europa.eu/idabc/eupl5
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the Licence is distributed on an "AS IS" basis,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the Licence for the specific language governing
13  * permissions and limitations under the Licence.
14  */
20 #include "TimeSlicer.h"
21 
22 #include "Sim.h"
23 
24 namespace SimPT_Sim {
25 
26 TimeSlicer::TimeSlicer(std::mutex& time_step_mutex, Sim* sim)
27  : m_guard(time_step_mutex), m_sim(sim)
28 {
29  m_sim->TimeSliceSetup(m_guard);
30 }
31 
33 {
34  m_sim->TimeSliceWrapup(m_guard);
35 }
36 
38 {
39  ++(m_sim->GetCoreData().m_time_data->m_sim_step);
40 }
41 
42 void TimeSlicer::Go(double time_slice, SimPhase phase)
43 {
44  m_sim->TimeSliceGo(m_guard, time_slice, phase);
45 }
46 
47 } // namespace
48 
void Go(double time_slice, SimPhase phase=SimPhase::NONE)
Actualy propagate over a time slice.
Definition: TimeSlicer.cpp:42
Simulator: mesh & parameters, model & algorithms.
Definition: Sim.h:50
TimeSlicer(std::mutex &time_step_mutex, Sim *sim)
Constructor does almost no initialization work.
Definition: TimeSlicer.cpp:26
Namespace for the core simulator.
Sim, the actual simulator.
~TimeSlicer()
Destructor does some wrapping up.
Definition: TimeSlicer.cpp:32
void IncrementStepCount()
Increment time step count because slices have covered a full step.
Definition: TimeSlicer.cpp:37
CoreData & GetCoreData() override final
Definition: Sim.h:68
Time slice propagation.