33#ifndef _CMGRAPHS_PROCSHAPE_H_
34#define _CMGRAPHS_PROCSHAPE_H_
42#include "chomp/system/textfile.h"
43#include "chomp/system/timeused.h"
44#include "chomp/struct/digraph.h"
45#include "chomp/struct/flatmatr.h"
46#include "chomp/struct/multitab.h"
47#include "chomp/cubes/neighbor.h"
61namespace procMorseDecShape {
64template <
class CubSetType>
67 using namespace chomp::homology;
72 int_t maxNeighbors = getmaxneighbors (X [0]. dim ());
73 int_t size = X. size ();
74 for (int_t n = 0; n < size; ++ n)
76 if (getneighbors (X [n],
static_cast<BitField *
> (0),
77 X,
static_cast<CubSetType *
> (0), 0) !=
94template <
class CubSetType,
class MorseDecType,
class GraphType,
97 const CubSetType &allCubes,
const GraphType &g,
98 const CubMapType &theCubMap,
const CubMapType &,
99 const std::string &cubesFilePrefix,
100 const std::string &procFilePrefix)
102 using namespace chomp::homology;
104 sout <<
"===== Post-processing the Morse sets. =====\n";
105 timeused timePostProc;
109 int nSets = morseDec. count ();
110 for (
int n = 0; n < nSets; ++ n)
112 const CubSetType &morseCubes = morseDec [n];
113 int_t morseCount = morseCubes. size ();
116 sbug <<
"Morse set no. " << n <<
": " <<
117 morseCount <<
" cubes.\n";
120 sbug <<
"Exit set: ";
122 for (
int i = 0; i < morseCount; ++ i)
123 theCubMap (morseCubes [i], &exitSet, 0, 0,
false);
124 exitSet. remove (morseCubes);
125 sbug << exitSet. size () <<
" cubes.\n";
128 if (!cubesFilePrefix. empty ())
131 std::ostringstream exitFileNameStr;
132 exitFileNameStr << cubesFilePrefix << n <<
"e.cub";
133 std::string exitFileName = exitFileNameStr. str ();
136 sbug <<
"Saving the exit set to '" <<
137 exitFileName <<
"'... ";
138 std::ofstream f (exitFileName. c_str ());
139 f <<
"; The exit set for the corresponding Morse "
140 "set (" << exitSet. size () <<
" cubes).\n";
147 sbug <<
"Computing the boundary of the exit set... ";
148 CubSetType exitSetBd;
150 sbug << exitSetBd. size () <<
" cubes.\n";
151 if (!exitSetBd. empty ())
153 sbug <<
"Exit set bounding box: ";
155 rangeExit (exitSetBd);
156 sbug << rangeExit <<
".\n";
160 if (!cubesFilePrefix. empty ())
163 std::ostringstream exitBdFileNameStr;
164 exitBdFileNameStr << cubesFilePrefix << n <<
166 std::string exitBdFileName =
167 exitBdFileNameStr. str ();
170 sbug <<
"Saving this boundary to '" <<
171 exitBdFileName <<
"'... ";
172 std::ofstream f (exitBdFileName. c_str ());
173 f <<
"; The boundary of the exit set "
174 "for the corresponding Morse set (" <<
175 exitSetBd. size () <<
" cubes).\n";
182 sbug <<
"Computing the boundary of the Morse set... ";
183 CubSetType morseBoundary;
185 sbug << morseBoundary. size () <<
" cubes.\n";
186 sbug <<
"Morse set bounding box: ";
188 rangeSet (morseBoundary);
189 sbug << rangeSet <<
".\n";
192 if (!cubesFilePrefix. empty ())
195 std::ostringstream bdFileNameStr;
196 bdFileNameStr << cubesFilePrefix << n <<
"b.cub";
197 std::string bdFileName = bdFileNameStr. str ();
200 sbug <<
"Saving this boundary to '" <<
201 bdFileName <<
"'... ";
202 std::ofstream f (bdFileName. c_str ());
203 f <<
"; The boundary of the Morse set (" <<
204 morseBoundary. size () <<
" cubes).\n";
215 sout <<
"===== Post-processing completed in " << timePostProc <<
A class whose objects store, update and show coordinate ranges.
Choice of configuration settings.
Conley index computation routines.
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...
void computeBoundary(const CubSetType &X, CubSetType &bd)
Computes the boundary of a set of cubes.
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.
Utilites and helper functions.