17 #ifndef MUELU_AGGREGATIONEXPORTFACTORY_DEF_HPP_
18 #define MUELU_AGGREGATIONEXPORTFACTORY_DEF_HPP_
21 #include <Xpetra_CrsMatrixWrap.hpp>
23 #include <Xpetra_MultiVectorFactory.hpp>
26 #include "MueLu_Aggregates.hpp"
28 #include "MueLu_AmalgamationFactory.hpp"
29 #include "MueLu_AmalgamationInfo.hpp"
41 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
43 : doFineGraphEdges_(false)
44 , doCoarseGraphEdges_(false)
51 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
54 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
58 std::string output_msg =
59 "Output filename template (%TIMESTEP is replaced by \'Output file: time step\' variable,"
60 "%ITER is replaced by \'Output file: iter\' variable, %LEVELID is replaced level id, %PROCID is replaced by processor id)";
61 std::string output_def =
"aggs_level%LEVELID_proc%PROCID.out";
70 validParamList->
set<std::string>(
"Output filename", output_def, output_msg);
71 validParamList->
set<
int>(
"Output file: time step", 0,
"time step variable for output file name");
72 validParamList->
set<
int>(
"Output file: iter", 0,
"nonlinear iteration variable for output file name");
75 validParamList->
set<std::string>(
"aggregation: output filename",
"",
"filename for VTK-style visualization output");
76 validParamList->
set<
int>(
"aggregation: output file: time step", 0,
"time step variable for output file name");
77 validParamList->
set<
int>(
"aggregation: output file: iter", 0,
"nonlinear iteration variable for output file name");
78 validParamList->
set<std::string>(
"aggregation: output file: agg style",
"Point Cloud",
"style of aggregate visualization for VTK output");
79 validParamList->
set<
bool>(
"aggregation: output file: fine graph edges",
false,
"Whether to draw all fine node connections along with the aggregates.");
80 validParamList->
set<
bool>(
"aggregation: output file: coarse graph edges",
false,
"Whether to draw all coarse node connections along with the aggregates.");
81 validParamList->
set<
bool>(
"aggregation: output file: build colormap",
false,
"Whether to output a random colormap for ParaView in a separate XML file.");
82 return validParamList;
85 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
87 Input(fineLevel,
"Aggregates");
88 Input(fineLevel,
"DofsPerNode");
89 Input(fineLevel,
"UnAmalgamationInfo");
93 if (pL.
isParameter(
"aggregation: output filename") && pL.
get<std::string>(
"aggregation: output filename").length()) {
94 Input(fineLevel,
"Coordinates");
95 Input(fineLevel,
"A");
96 Input(fineLevel,
"Graph");
97 if (pL.
get<
bool>(
"aggregation: output file: coarse graph edges")) {
98 Input(coarseLevel,
"Coordinates");
99 Input(coarseLevel,
"A");
100 Input(coarseLevel,
"Graph");
105 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
113 int numProcs = comm->getSize();
114 int myRank = comm->getRank();
115 string masterFilename = pL.
get<std::string>(
"aggregation: output filename");
116 string pvtuFilename =
"";
117 string localFilename = pL.get<std::string>(
"Output filename");
118 string filenameToWrite;
120 doCoarseGraphEdges_ = pL.get<
bool>(
"aggregation: output file: coarse graph edges");
121 doFineGraphEdges_ = pL.get<
bool>(
"aggregation: output file: fine graph edges");
122 if (masterFilename.length()) {
124 filenameToWrite = masterFilename;
125 if (filenameToWrite.rfind(
".vtu") == string::npos)
126 filenameToWrite.append(
".vtu");
127 if (numProcs > 1 && filenameToWrite.rfind(
"%PROCID") == string::npos)
128 filenameToWrite.insert(filenameToWrite.rfind(
".vtu"),
"-proc%PROCID");
130 filenameToWrite = localFilename;
131 LocalOrdinal DofsPerNode = Get<LocalOrdinal>(fineLevel,
"DofsPerNode");
135 if (doCoarseGraphEdges_)
136 Ac = Get<RCP<Matrix> >(coarseLevel,
"A");
141 if (doFineGraphEdges_)
142 fineGraph = Get<RCP<LWGraph> >(fineLevel,
"Graph");
143 if (doCoarseGraphEdges_)
144 coarseGraph = Get<RCP<LWGraph> >(coarseLevel,
"Graph");
147 coords = Get<RCP<CoordinateMultiVector> >(fineLevel,
"Coordinates");
149 if (doCoarseGraphEdges_)
150 coordsCoarse = Get<RCP<CoordinateMultiVector> >(coarseLevel,
"Coordinates");
151 dims_ = coords->getNumVectors();
153 if (aggregates->AggregatesCrossProcessors()) {
157 coords = ghostedCoords;
158 coords_ = ghostedCoords;
160 if (doCoarseGraphEdges_) {
163 ghostedCoords->doImport(*coordsCoarse, *coordImporter,
Xpetra::INSERT);
164 coordsCoarse = ghostedCoords;
165 coordsCoarse_ = ghostedCoords;
169 GetOStream(
Runtime0) <<
"AggregationExportFactory: DofsPerNode: " << DofsPerNode << std::endl;
175 vertex2AggId_ = vertex2AggId;
178 std::vector<GlobalOrdinal> numAggsGlobal(numProcs, 0);
179 std::vector<GlobalOrdinal> numAggsLocal(numProcs, 0);
180 std::vector<GlobalOrdinal> minGlobalAggId(numProcs, 0);
182 numAggsLocal[myRank] = aggregates->GetNumAggregates();
183 Teuchos::reduceAll(*comm,
Teuchos::REDUCE_SUM, numProcs, &numAggsLocal[0], &numAggsGlobal[0]);
184 for (
int i = 1; i < Teuchos::as<int>(numAggsGlobal.size()); ++i) {
185 numAggsGlobal[i] += numAggsGlobal[i - 1];
186 minGlobalAggId[i] = numAggsGlobal[i - 1];
191 aggsOffset_ = minGlobalAggId[myRank];
194 amalgInfo->UnamalgamateAggregates(*aggregates, aggStart, aggToRowMap);
195 int timeStep = pL.
get<
int>(
"Output file: time step");
196 int iter = pL.get<
int>(
"Output file: iter");
202 string masterStem =
"";
204 masterStem = filenameToWrite.substr(0, filenameToWrite.rfind(
".vtu"));
205 masterStem = this->
replaceAll(masterStem,
"%PROCID",
"");
207 pvtuFilename = masterStem +
"-master.pvtu";
208 string baseFname = filenameToWrite;
210 GetOStream(
Runtime0) <<
"AggregationExportFactory: outputfile \"" << filenameToWrite <<
"\"" << std::endl;
211 ofstream fout(filenameToWrite.c_str());
212 GO numAggs = aggregates->GetNumAggregates();
214 GO indexBase = aggregates->GetMap()->getIndexBase();
215 GO offset = amalgInfo->GlobalOffset();
216 vector<GlobalOrdinal> nodeIds;
217 for (
int i = 0; i < numAggs; ++i) {
218 fout <<
"Agg " << minGlobalAggId[myRank] + i <<
" Proc " << myRank <<
":";
221 for (
int k = aggStart[i]; k < aggStart[i + 1]; ++k) {
222 nodeIds.push_back((aggToRowMap[k] - offset - indexBase) / DofsPerNode + indexBase);
226 std::sort(nodeIds.begin(), nodeIds.end());
227 typename std::vector<GlobalOrdinal>::iterator endLocation = std::unique(nodeIds.begin(), nodeIds.end());
228 nodeIds.erase(endLocation, nodeIds.end());
231 for (
typename std::vector<GlobalOrdinal>::iterator printIt = nodeIds.begin(); printIt != nodeIds.end(); printIt++)
232 fout <<
" " << *printIt;
241 numNodes_ = coords->getLocalLength();
243 aggSizes_ = aggregates->ComputeAggregateSizesArrayRCP();
245 string aggStyle =
"Point Cloud";
247 aggStyle = pL.get<
string>(
"aggregation: output file: agg style");
248 }
catch (std::exception& e) {
250 vector<int> vertices;
251 vector<int> geomSizes;
253 nodeMap_ = Amat->getMap();
255 isRoot_.push_back(aggregates->IsRoot(i));
259 if (myRank == 0 && (numProcs != 1 || doCoarseGraphEdges_ || doFineGraphEdges_)) {
260 ofstream pvtu(pvtuFilename.c_str());
261 writePVTU_(pvtu, baseFname, numProcs);
264 if (aggStyle ==
"Point Cloud")
265 this->doPointCloud(vertices, geomSizes, numAggs_, numNodes_);
266 else if (aggStyle ==
"Jacks")
267 this->doJacks(vertices, geomSizes, numAggs_, numNodes_, isRoot_, vertex2AggId_);
268 else if (aggStyle ==
"Jacks++")
269 doJacksPlus_(vertices, geomSizes);
270 else if (aggStyle ==
"Convex Hulls")
271 doConvexHulls(vertices, geomSizes);
273 GetOStream(
Warnings0) <<
" Unrecognized agg style.\n Possible values are Point Cloud, Jacks, Jacks++, and Convex Hulls.\n Defaulting to Point Cloud." << std::endl;
274 aggStyle =
"Point Cloud";
275 this->doPointCloud(vertices, geomSizes, numAggs_, numNodes_);
277 writeFile_(fout, aggStyle, vertices, geomSizes);
278 if (doCoarseGraphEdges_) {
279 string fname = filenameToWrite;
280 string cEdgeFile = fname.insert(fname.rfind(
".vtu"),
"-coarsegraph");
281 std::ofstream edgeStream(cEdgeFile.c_str());
282 doGraphEdges_(edgeStream, Ac, coarseGraph,
false, DofsPerNode);
284 if (doFineGraphEdges_) {
285 string fname = filenameToWrite;
286 string fEdgeFile = fname.insert(fname.rfind(
".vtu"),
"-finegraph");
287 std::ofstream edgeStream(fEdgeFile.c_str());
288 doGraphEdges_(edgeStream, Amat, fineGraph,
true, DofsPerNode);
290 if (myRank == 0 && pL.get<
bool>(
"aggregation: output file: build colormap")) {
297 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
302 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
309 this->doConvexHulls2D(vertices, geomSizes, numAggs_, numNodes_, isRoot_, vertex2AggId_, xCoords, yCoords);
311 zCoords = coords_->getData(2);
312 this->doConvexHulls3D(vertices, geomSizes, numAggs_, numNodes_, isRoot_, vertex2AggId_, xCoords, yCoords, zCoords);
316 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
321 vector<pair<int, int> > vert1;
322 vector<pair<int, int> > vert2;
328 zCoords = coords_->getData(2);
334 cz = coordsCoarse_->getData(2);
336 if (A->isGloballyIndexed()) {
340 A->getGlobalRowView(globRow, indices, values);
341 auto neighbors = G->getNeighborVertices((
LocalOrdinal)globRow);
344 while (gEdge !=
int(neighbors.length)) {
346 if (neighbors(gEdge) == indices[aEdge]) {
348 vert1.push_back(pair<int, int>(
int(globRow), neighbors(gEdge)));
353 vert2.push_back(pair<int, int>(
int(globRow), neighbors(gEdge)));
358 vert1.push_back(pair<int, int>(
int(globRow), neighbors(gEdge)));
367 A->getLocalRowView(locRow, indices, values);
368 auto neighbors = G->getNeighborVertices(locRow);
372 while (gEdge !=
int(neighbors.length)) {
374 if (neighbors(gEdge) == indices[aEdge]) {
375 vert1.push_back(pair<int, int>(locRow, neighbors(gEdge)));
379 vert2.push_back(pair<int, int>(locRow, neighbors(gEdge)));
383 vert1.push_back(pair<int, int>(locRow, neighbors(gEdge)));
389 for (
size_t i = 0; i < vert1.size(); i++) {
390 if (vert1[i].first > vert1[i].second) {
391 int temp = vert1[i].first;
392 vert1[i].first = vert1[i].second;
393 vert1[i].second = temp;
396 for (
size_t i = 0; i < vert2.size(); i++) {
397 if (vert2[i].first > vert2[i].second) {
398 int temp = vert2[i].first;
399 vert2[i].first = vert2[i].second;
400 vert2[i].second = temp;
403 sort(vert1.begin(), vert1.end());
404 vector<pair<int, int> >::iterator newEnd = unique(vert1.begin(), vert1.end());
405 vert1.erase(newEnd, vert1.end());
406 sort(vert2.begin(), vert2.end());
407 newEnd = unique(vert2.begin(), vert2.end());
408 vert2.erase(newEnd, vert2.end());
410 points1.reserve(2 * vert1.size());
411 for (
size_t i = 0; i < vert1.size(); i++) {
412 points1.push_back(vert1[i].first);
413 points1.push_back(vert1[i].second);
416 points2.reserve(2 * vert2.size());
417 for (
size_t i = 0; i < vert2.size(); i++) {
418 points2.push_back(vert2[i].first);
419 points2.push_back(vert2[i].second);
421 vector<int> unique1 = this->makeUnique(points1);
422 vector<int> unique2 = this->makeUnique(points2);
423 fout <<
"<VTKFile type=\"UnstructuredGrid\" byte_order=\"LittleEndian\">" << endl;
424 fout <<
" <UnstructuredGrid>" << endl;
425 fout <<
" <Piece NumberOfPoints=\"" << unique1.size() + unique2.size() <<
"\" NumberOfCells=\"" << vert1.size() + vert2.size() <<
"\">" << endl;
426 fout <<
" <PointData Scalars=\"Node Aggregate Processor\">" << endl;
427 fout <<
" <DataArray type=\"Int32\" Name=\"Node\" format=\"ascii\">" << endl;
430 for (
size_t i = 0; i < unique1.size(); i++) {
431 fout << CONTRAST_1_ <<
" ";
436 for (
size_t i = 0; i < unique2.size(); i++) {
437 fout << CONTRAST_2_ <<
" ";
438 if ((i + 2 * vert1.size()) % 25 == 24)
443 fout <<
" </DataArray>" << endl;
444 fout <<
" <DataArray type=\"Int32\" Name=\"Aggregate\" format=\"ascii\">" << endl;
446 for (
size_t i = 0; i < unique1.size(); i++) {
447 fout << CONTRAST_1_ <<
" ";
452 for (
size_t i = 0; i < unique2.size(); i++) {
453 fout << CONTRAST_2_ <<
" ";
454 if ((i + 2 * vert2.size()) % 25 == 24)
459 fout <<
" </DataArray>" << endl;
460 fout <<
" <DataArray type=\"Int32\" Name=\"Processor\" format=\"ascii\">" << endl;
462 for (
size_t i = 0; i < unique1.size() + unique2.size(); i++) {
463 fout << myRank_ <<
" ";
469 fout <<
" </DataArray>" << endl;
470 fout <<
" </PointData>" << endl;
471 fout <<
" <Points>" << endl;
472 fout <<
" <DataArray type=\"Float64\" NumberOfComponents=\"3\" format=\"ascii\">" << endl;
474 for (
size_t i = 0; i < unique1.size(); i++) {
476 fout << xCoords[unique1[i]] <<
" " << yCoords[unique1[i]] <<
" ";
478 fout << zCoords[unique1[i]] <<
" ";
485 fout << cx[unique1[i]] <<
" " << cy[unique1[i]] <<
" ";
487 fout << cz[unique1[i]] <<
" ";
495 for (
size_t i = 0; i < unique2.size(); i++) {
497 fout << xCoords[unique2[i]] <<
" " << yCoords[unique2[i]] <<
" ";
499 fout << zCoords[unique2[i]] <<
" ";
506 fout << cx[unique2[i]] <<
" " << cy[unique2[i]] <<
" ";
508 fout << cz[unique2[i]] <<
" ";
511 if ((i + unique1.size()) % 2)
517 fout <<
" </DataArray>" << endl;
518 fout <<
" </Points>" << endl;
519 fout <<
" <Cells>" << endl;
520 fout <<
" <DataArray type=\"Int32\" Name=\"connectivity\" format=\"ascii\">" << endl;
522 for (
size_t i = 0; i < points1.size(); i++) {
523 fout << points1[i] <<
" ";
528 for (
size_t i = 0; i < points2.size(); i++) {
529 fout << points2[i] + unique1.size() <<
" ";
530 if ((i + points1.size()) % 10 == 9)
535 fout <<
" </DataArray>" << endl;
536 fout <<
" <DataArray type=\"Int32\" Name=\"offsets\" format=\"ascii\">" << endl;
539 for (
size_t i = 0; i < vert1.size() + vert2.size(); i++) {
541 fout << offset <<
" ";
547 fout <<
" </DataArray>" << endl;
548 fout <<
" <DataArray type=\"Int32\" Name=\"types\" format=\"ascii\">" << endl;
550 for (
size_t i = 0; i < vert1.size() + vert2.size(); i++) {
557 fout <<
" </DataArray>" << endl;
558 fout <<
" </Cells>" << endl;
559 fout <<
" </Piece>" << endl;
560 fout <<
" </UnstructuredGrid>" << endl;
561 fout <<
"</VTKFile>" << endl;
564 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
572 zCoords = coords_->getData(2);
574 vector<int> uniqueFine = this->makeUnique(vertices);
576 fout <<
"<!--" << styleName <<
" Aggregates Visualization-->" << endl;
577 fout <<
"<VTKFile type=\"UnstructuredGrid\" byte_order=\"LittleEndian\">" << endl;
578 fout <<
" <UnstructuredGrid>" << endl;
579 fout <<
" <Piece NumberOfPoints=\"" << uniqueFine.size() <<
"\" NumberOfCells=\"" << geomSizes.size() <<
"\">" << endl;
580 fout <<
" <PointData Scalars=\"Node Aggregate Processor\">" << endl;
581 fout <<
" <DataArray type=\"Int32\" Name=\"Node\" format=\"ascii\">" << endl;
585 for (
size_t i = 0; i < uniqueFine.size(); i++) {
587 fout << uniqueFine[i] <<
" ";
589 fout << nodeMap_->getGlobalElement(uniqueFine[i]) <<
" ";
595 fout <<
" </DataArray>" << endl;
596 fout <<
" <DataArray type=\"Int32\" Name=\"Aggregate\" format=\"ascii\">" << endl;
598 for (
size_t i = 0; i < uniqueFine.size(); i++) {
599 if (vertex2AggId_[uniqueFine[i]] == -1)
600 fout << vertex2AggId_[uniqueFine[i]] <<
" ";
602 fout << aggsOffset_ + vertex2AggId_[uniqueFine[i]] <<
" ";
608 fout <<
" </DataArray>" << endl;
609 fout <<
" <DataArray type=\"Int32\" Name=\"Processor\" format=\"ascii\">" << endl;
611 for (
size_t i = 0; i < uniqueFine.size(); i++) {
612 fout << myRank_ <<
" ";
618 fout <<
" </DataArray>" << endl;
619 fout <<
" </PointData>" << endl;
620 fout <<
" <Points>" << endl;
621 fout <<
" <DataArray type=\"Float64\" NumberOfComponents=\"3\" format=\"ascii\">" << endl;
623 for (
size_t i = 0; i < uniqueFine.size(); i++) {
624 fout << xCoords[uniqueFine[i]] <<
" " << yCoords[uniqueFine[i]] <<
" ";
628 fout << zCoords[uniqueFine[i]] <<
" ";
634 fout <<
" </DataArray>" << endl;
635 fout <<
" </Points>" << endl;
636 fout <<
" <Cells>" << endl;
637 fout <<
" <DataArray type=\"Int32\" Name=\"connectivity\" format=\"ascii\">" << endl;
639 for (
size_t i = 0; i < vertices.size(); i++) {
640 fout << vertices[i] <<
" ";
646 fout <<
" </DataArray>" << endl;
647 fout <<
" <DataArray type=\"Int32\" Name=\"offsets\" format=\"ascii\">" << endl;
650 for (
size_t i = 0; i < geomSizes.size(); i++) {
651 accum += geomSizes[i];
652 fout << accum <<
" ";
658 fout <<
" </DataArray>" << endl;
659 fout <<
" <DataArray type=\"Int32\" Name=\"types\" format=\"ascii\">" << endl;
661 for (
size_t i = 0; i < geomSizes.size(); i++) {
662 switch (geomSizes[i]) {
680 fout <<
" </DataArray>" << endl;
681 fout <<
" </Cells>" << endl;
682 fout <<
" </Piece>" << endl;
683 fout <<
" </UnstructuredGrid>" << endl;
684 fout <<
"</VTKFile>" << endl;
687 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
691 ofstream color(
"random-colormap.xml");
692 color <<
"<ColorMap name=\"MueLu-Random\" space=\"RGB\">" << endl;
695 color <<
" <Point x=\"" << CONTRAST_1_ <<
"\" o=\"1\" r=\"1\" g=\"0\" b=\"0\"/>" << endl;
696 color <<
" <Point x=\"" << CONTRAST_2_ <<
"\" o=\"1\" r=\"1\" g=\"0.6\" b=\"0\"/>" << endl;
697 color <<
" <Point x=\"" << CONTRAST_3_ <<
"\" o=\"1\" r=\"1\" g=\"1\" b=\"0\"/>" << endl;
699 for (
int i = 0; i < 5000; i += 4) {
700 color <<
" <Point x=\"" << i <<
"\" o=\"1\" r=\"" << (rand() % 50) / 256.0 <<
"\" g=\"" << (rand() % 256) / 256.0 <<
"\" b=\"" << (rand() % 256) / 256.0 <<
"\"/>" << endl;
702 color <<
"</ColorMap>" << endl;
704 }
catch (std::exception& e) {
705 GetOStream(
Warnings0) <<
" Error while building colormap file: " << e.what() << endl;
709 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
715 pvtu <<
"<VTKFile type=\"PUnstructuredGrid\" byte_order=\"LittleEndian\">" << endl;
716 pvtu <<
" <PUnstructuredGrid GhostLevel=\"0\">" << endl;
717 pvtu <<
" <PPointData Scalars=\"Node Aggregate Processor\">" << endl;
718 pvtu <<
" <PDataArray type=\"Int32\" Name=\"Node\"/>" << endl;
719 pvtu <<
" <PDataArray type=\"Int32\" Name=\"Aggregate\"/>" << endl;
720 pvtu <<
" <PDataArray type=\"Int32\" Name=\"Processor\"/>" << endl;
721 pvtu <<
" </PPointData>" << endl;
722 pvtu <<
" <PPoints>" << endl;
723 pvtu <<
" <PDataArray type=\"Float64\" NumberOfComponents=\"3\"/>" << endl;
724 pvtu <<
" </PPoints>" << endl;
725 for (
int i = 0; i < numProcs; i++) {
727 pvtu <<
" <Piece Source=\"" << this->
replaceAll(baseFname,
"%PROCID",
toString(i)) <<
"\"/>" << endl;
730 if (doFineGraphEdges_) {
731 for (
int i = 0; i < numProcs; i++) {
733 pvtu <<
" <Piece Source=\"" << fn.insert(fn.rfind(
".vtu"),
"-finegraph") <<
"\"/>" << endl;
736 if (doCoarseGraphEdges_) {
737 for (
int i = 0; i < numProcs; i++) {
739 pvtu <<
" <Piece Source=\"" << fn.insert(fn.rfind(
".vtu"),
"-coarsegraph") <<
"\"/>" << endl;
742 pvtu <<
" </PUnstructuredGrid>" << endl;
743 pvtu <<
"</VTKFile>" << endl;
Important warning messages (one line)
MueLu::DefaultLocalOrdinal LocalOrdinal
std::string toString(const T &what)
Little helper function to convert non-string types to strings.
static Teuchos::RCP< MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > Build(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node >> &map, size_t NumVectors, bool zeroOut=true)
T & get(const std::string &name, T def_value)
Timer to be used in factories. Similar to Monitor but with additional timers.
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
One-liner description of what is happening.
void doConvexHulls(std::vector< int > &vertices, std::vector< int > &geomSizes) const
ParameterList & set(std::string const &name, T &&value, std::string const &docString="", RCP< const ParameterEntryValidator > const &validator=null)
void writeFile_(std::ofstream &fout, std::string styleName, std::vector< int > &vertices, std::vector< int > &geomSizes) const
void sort(View &view, const size_t &size)
bool isParameter(const std::string &name) const
virtual ~AggregationExportFactory()
Destructor.
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
MueLu::DefaultGlobalOrdinal GlobalOrdinal
Class that holds all level-specific information.
RCP< const ParameterList > GetValidParameterList() const
Return a const parameter list of valid parameters that setParameterList() will accept.
void writePVTU_(std::ofstream &pvtu, std::string baseFname, int numProcs) const
void DeclareInput(Level &fineLevel, Level &coarseLevel) const
Input.
void doGraphEdges_(std::ofstream &fout, Teuchos::RCP< Matrix > &A, Teuchos::RCP< LWGraph > &G, bool fine, int dofs) const
int GetLevelID() const
Return level number.
Exception throws to report errors in the internal logical of the program.
void doJacksPlus_(std::vector< int > &vertices, std::vector< int > &geomSizes) const
AggregationExportFactory()
Constructor.
void Build(Level &fineLevel, Level &coarseLevel) const
Build an object with this factory.
void replaceAll(std::string &str, const std::string &from, const std::string &to)
static RCP< Import< LocalOrdinal, GlobalOrdinal, Node > > Build(const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &source, const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &target, const Teuchos::RCP< Teuchos::ParameterList > &plist=Teuchos::null)
void buildColormap_() const