suanPan
Loading...
Searching...
No Matches
EnergyEvolution.h
Go to the documentation of this file.
1/*******************************************************************************
2 * Copyright (C) 2017-2023 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:
63 EnergyEvolution(unsigned, // tag
64 unsigned, // step tag
65 unsigned, // incre level
66 unsigned, // final level
67 double = 1., // centre weight
68 unsigned = 2, // propagation iteration
69 unsigned = 10, // reactivation ratio
70 double = .5, // propagation weight
71 double = 1E-5 // tolerance
72 );
73
74 int initialize(const shared_ptr<DomainBase>&) override;
75
76 int process(const shared_ptr<DomainBase>&) override;
77};
78
79#endif
80
A Criterion class.
Definition Criterion.h:38
A Element class.
Definition Element.h:106
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
std::function< double(const Element *)> get_energy
Definition EnergyEvolution.h:60
vector< set< T > > graph
Definition container.h:59