VPTissue Reference Manual
HousekeepGrow.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 "HousekeepGrow.h"
21 
22 #include "Housekeep.h"
23 #include "Grow.h"
24 
25 #include <cassert>
26 #include <boost/property_tree/ptree.hpp>
27 
28 namespace SimPT_Default {
29 namespace TimeEvolver {
30 
31 using namespace std;
32 using namespace boost::property_tree;
33 
35 {
36  Initialize(cd);
37 }
38 
40 {
41  assert( cd.Check() && "CoreData not ok.");
42  m_cd = cd;
43 }
44 
45 std::tuple<SimTimingTraits::CumulativeTimings, bool> HousekeepGrow::operator()(double /*time_slice*/, SimPhase /*phase*/)
46 {
47  // -------------------------------------------------------------------------------
48  // Cell housekeeping a.o. division.
49  // -------------------------------------------------------------------------------
50  Housekeep housekeeper(m_cd);
51  auto tup1 = housekeeper();
52  CumulativeTimings timings(get<0>(tup1));
53  bool is_stationary = get<1>(tup1);
54 
55  // -------------------------------------------------------------------------------
56  // Metropolis loop until relaxation.
57  // -------------------------------------------------------------------------------
58  Grow grower(m_cd);
59  auto tup2 = grower();
60  timings.Merge(get<0>(tup2));
61  is_stationary = is_stationary && get<1>(tup2);
62 
63  // -------------------------------------------------------------------------------
64  // We are done ...
65  // -------------------------------------------------------------------------------
66  return make_tuple(timings, is_stationary);
67 }
68 
69 } // namespace
70 } // namespace
Core data with mesh, parameters, random engine and time data.
Definition: CoreData.h:38
STL namespace.
Time evolver for Housekeeping only.
Namespace for components of the Default model group.
Utility class to record durations in a cumulative manner.
Growth and division time evolution algorithm.
Definition: Grow.h:36
std::tuple< SimTimingTraits::CumulativeTimings, bool > operator()(double time_slice=0.0, SimPhase phase=SimPhase::NONE)
Take a time evolution step.
HousekeepGrow(const CoreData &cd)
Initializing constructor.
void Initialize(const CoreData &cd)
Initialize or re-initialize.
Housekeep time step algorithm.
Definition: Housekeep.h:34
void Merge(const CumulativeRecords< U > &extra)
Merge an extra set of records (casting durations if required).
Time evolver for Housekeep plus Grow.
Time evolver for Grow only.
bool Check() const
Verify all pointers non-null.
Definition: CoreData.h:53