suanPan
EnergyEvolution.h
Go to the documentation of this file.
1/*******************************************************************************
2 * Copyright (C) 2017-2024 Theodore Chang
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 ******************************************************************************/
31#ifndef ENERGYEVOLUTION_H
32#define ENERGYEVOLUTION_H
33
35#include <Toolbox/container.h>
36
37class Element;
38
39class EnergyEvolution : public Criterion {
40 const unsigned iteration, reactive_ratio;
41
42 const unsigned incre_level, final_level;
43
44 const double weight, propagation_weight;
45
46 const double tolerance;
47
49 std::vector<unsigned> index;
50
51 unsigned current_level = incre_level;
52
53 vec energy;
54
55 double total_energy = 0.;
56
57 unsigned balanced_iteration = 0;
58
59protected:
60 std::function<double(const Element*)> get_energy;
61
62public:
64 unsigned, // tag
65 unsigned, // step tag
66 unsigned, // incre level
67 unsigned, // final level
68 double = 1., // centre weight
69 unsigned = 2, // propagation iteration
70 unsigned = 10, // reactivation ratio
71 double = .5, // propagation weight
72 double = 1E-5 // tolerance
73 );
74
75 int initialize(const shared_ptr<DomainBase>&) override;
76
77 int process(const shared_ptr<DomainBase>&) override;
78};
79
80#endif
81
A Criterion class.
Definition: Criterion.h:38
A Element class.
Definition: Element.h:117
A EnergyEvolution class.
Definition: EnergyEvolution.h:39
int initialize(const shared_ptr< DomainBase > &) override
Definition: EnergyEvolution.cpp:34
int process(const shared_ptr< DomainBase > &) override
Definition: EnergyEvolution.cpp:42
EnergyEvolution(unsigned, unsigned, unsigned, unsigned, double=1., unsigned=2, unsigned=10, double=.5, double=1E-5)
Definition: EnergyEvolution.cpp:23
std::function< double(const Element *)> get_energy
Definition: EnergyEvolution.h:60
vector< set< T > > graph
Definition: container.h:59