32#ifndef _CMGRAPHS_PROCHARV_H_
33#define _CMGRAPHS_PROCHARV_H_
41#include "chomp/system/textfile.h"
42#include "chomp/system/timeused.h"
43#include "chomp/struct/digraph.h"
44#include "chomp/struct/flatmatr.h"
45#include "chomp/struct/multitab.h"
46#include "chomp/cubes/neighbor.h"
60namespace procMorseDecHarv {
69template <
class CubSetType,
class MorseDecType,
class GraphType,
72 const CubSetType &allCubes,
const GraphType &g,
73 const CubMapType &theCubMap,
const CubMapType &,
74 const std::string &cubesFilePrefix,
75 const std::string &procFilePrefix)
77 using namespace chomp::homology;
79 sbug <<
"===== Post-processing the Morse sets. =====\n";
80 timeused timePostProc;
84 double attrPopSize = 0;
91 int nSets = morseDec. count ();
92 for (
int n = 0; n < nSets; ++ n)
94 const CubSetType &morseCubes = morseDec [n];
95 int_t morseCount = morseCubes. size ();
98 sbug <<
"Morse set no. " << n <<
": " <<
99 morseCount <<
" cubes, ";
102 sbug <<
"exit set: ";
104 for (
int i = 0; i < morseCount; ++ i)
105 theCubMap (morseCubes [i], &exitSet, 0, 0, 0,
false);
106 exitSet. remove (morseCubes);
107 sbug << exitSet. size () <<
" cubes.\n";
110 if (!cubesFilePrefix. empty ())
113 std::ostringstream exitFileNameStr;
114 exitFileNameStr << cubesFilePrefix << n <<
"e.cub";
115 std::string exitFileName = exitFileNameStr. str ();
118 sbug <<
"Saving the exit set to '" <<
119 exitFileName <<
"'... ";
120 std::ofstream f (exitFileName. c_str ());
121 f <<
"; The exit set for the corresponding Morse "
122 "set (" << exitSet. size () <<
" cubes).\n";
137 for (
int k = 0; k < morseCount; ++ k)
140 morseCubes [k]. coord (c);
145 (c [i] + 0.5) * boxSize [i];
147 popSizes [i] += size;
151 popSize /= morseCount;
152 sbug <<
"Avg pop sizes: ";
155 popSizes [i] /= morseCount;
156 sbug << (i ?
" + " :
"") << popSizes [i];
158 sbug <<
" = " << popSize <<
".\n";
162 for (
int m = 0; m < nSets; ++ m)
164 if (morseDec. connected (n, m))
172 if ((attractor < 0) && bottom)
174 attrPopSize = popSize;
176 attrPopSizes [i] = popSizes [i];
177 attractor = exitSet. empty () ? n : (-1 - n);
182 int attrIndex = (attractor < 0) ? (-1 - attractor) : attractor;
183 sbug << ((attractor < 0) ?
"Non-isol a" :
"A") <<
"ttractor " <<
184 attrIndex <<
" (" << morseDec [attrIndex]. size () <<
185 " cubes), avg pop sizes: ";
187 sbug << (i ?
" + " :
"") << attrPopSizes [i];
188 sbug <<
" = " << attrPopSize <<
". Coord ranges: ";
190 coordMinMax (morseDec [attrIndex]);
191 sbug << coordMinMax <<
".\n";
193 sbug <<
"===== Post-processing completed in " << timePostProc <<
A class whose objects store, update and show coordinate ranges.
Choice of configuration settings.
Conley index computation routines.
const SpaceOffsetType spaceOffset
An imitation of an array which returns the offset of the rectangular area in the phase space which co...
const int spaceDim
The dimension of the phase space.
const SpaceWidthType spaceWidth
An imitation of an array which returns the width of the rectangular area in the phase space which con...
const int finalDepth
The final depth of subdivisions in the phase space.
void processMorseDec(const MorseDecType &morseDec, const CubSetType &allCubes, const GraphType &g, const CubMapType &theCubMap, const CubMapType &, const std::string &cubesFilePrefix, const std::string &procFilePrefix)
Post-processes a Morse decomposition by computing a decomposition of each Morse set into cycle sets a...
Customizable settings that are supposed to be modified and/or chosen by the user of the software.
Customizable data types for the Conley-Morse graphs computation program.
Data types for the dynamical systems data structures.
int spcCoord
The type of coordinates of cubes in the phase space.
Utilites and helper functions.