47 #ifndef MUELU_VISUALIZATIONHELPERS_DECL_HPP_ 48 #define MUELU_VISUALIZATIONHELPERS_DECL_HPP_ 50 #include <Xpetra_Matrix_fwd.hpp> 51 #include <Xpetra_CrsMatrixWrap_fwd.hpp> 85 myVec3(
double xin,
double yin,
double zin) :
x(xin),
y(yin),
z(zin) {}
96 myVec2(
double xin,
double yin) :
x(xin),
y(yin) {}
111 template <
class Scalar =
double,
class LocalOrdinal =
int,
class GlobalOrdinal = LocalOrdinal,
class Node = KokkosClassic::DefaultNode::DefaultNodeType>
113 #undef MUELU_VISUALIZATIONHELPERS_SHORT 131 void writeFileVTKOpening(std::ofstream & fout, std::vector<int> & uniqueFine, std::vector<int> & geomSizesFine)
const;
132 void writeFileVTKNodes(std::ofstream & fout, std::vector<int> & uniqueFine, Teuchos::RCP<const Map> & nodeMap)
const;
133 void writeFileVTKData(std::ofstream & fout, std::vector<int> & uniqueFine, LocalOrdinal myAggOffset, ArrayRCP<LocalOrdinal> & vertex2AggId,
int myRank)
const;
134 void writeFileVTKCoordinates(std::ofstream & fout, std::vector<int> & uniqueFine, Teuchos::ArrayRCP<const double> & fx, Teuchos::ArrayRCP<const double> & fy, Teuchos::ArrayRCP<const double> & fz,
int dim)
const;
135 void writeFileVTKCells(std::ofstream & fout, std::vector<int> & uniqueFine, std::vector<LocalOrdinal> & vertices, std::vector<LocalOrdinal> & geomSize)
const;
137 void writePVTU(std::ofstream& pvtu, std::string baseFname,
int numProcs,
bool bFineEdges =
false,
bool bCoarseEdges =
false)
const;
140 std::string
getFileName(
int numProcs,
int myRank,
int level,
const Teuchos::ParameterList& pL)
const;
141 std::string
getBaseFileName(
int numProcs,
int level,
const Teuchos::ParameterList& pL)
const;
142 std::string
getPVTUFileName(
int numProcs,
int myRank,
int level,
const Teuchos::ParameterList& pL)
const;
145 static void doPointCloud(std::vector<int>& vertices, std::vector<int>& geomSizes, LO numLocalAggs, LO numFineNodes);
146 static void doJacks(std::vector<int>& vertices, std::vector<int>& geomSizes, LO numLocalAggs, LO numFineNodes,
const std::vector<bool>& isRoot,
const ArrayRCP<LO>& vertex2AggId);
147 static void doConvexHulls2D(std::vector<int>& vertices, std::vector<int>& geomSizes, LO numLocalAggs, LO numFineNodes,
const std::vector<bool>& isRoot,
const ArrayRCP<LO>& vertex2AggId,
const Teuchos::ArrayRCP<const double>& xCoords,
const Teuchos::ArrayRCP<const double>& yCoords);
148 static void doConvexHulls3D(std::vector<int>& vertices, std::vector<int>& geomSizes, LO numLocalAggs, LO numFineNodes,
const std::vector<bool>& isRoot,
const ArrayRCP<LO>& vertex2AggId,
const Teuchos::ArrayRCP<const double>& xCoords,
const Teuchos::ArrayRCP<const double>& yCoords,
const Teuchos::ArrayRCP<const double>& zCoords);
150 #ifdef HAVE_MUELU_CGAL 151 static void doCGALConvexHulls2D(std::vector<int>& vertices, std::vector<int>& geomSizes, LO numLocalAggs, LO numFineNodes,
const std::vector<bool>& isRoot,
const ArrayRCP<LO>& vertex2AggId,
const Teuchos::ArrayRCP<const double>& xCoords,
const Teuchos::ArrayRCP<const double>& yCoords);
152 static void doCGALConvexHulls3D(std::vector<int>& vertices, std::vector<int>& geomSizes, LO numLocalAggs, LO numFineNodes,
const std::vector<bool>& isRoot,
const ArrayRCP<LO>& vertex2AggId,
const Teuchos::ArrayRCP<const double>& xCoords,
const Teuchos::ArrayRCP<const double>& yCoords,
const Teuchos::ArrayRCP<const double>& zCoords);
155 static void doGraphEdges(std::vector<int>& vertices, std::vector<int>& geomSizes, Teuchos::RCP<GraphBase>& G, Teuchos::ArrayRCP<const double> & fx, Teuchos::ArrayRCP<const double> & fy, Teuchos::ArrayRCP<const double> & fz);
170 static std::vector<myTriangle>
processTriangle(std::list<myTriangle>& tris,
myTriangle tri, std::list<int>& pointsInFront,
myVec3& barycenter,
const Teuchos::ArrayRCP<const double>& xCoords,
const Teuchos::ArrayRCP<const double>& yCoords,
const Teuchos::ArrayRCP<const double>& zCoords);
171 static std::vector<int>
giftWrap(std::vector<myVec2>& points, std::vector<int>& nodes,
const Teuchos::ArrayRCP<const double> & xCoords,
const Teuchos::ArrayRCP<const double> & yCoords);
173 std::string
replaceAll(std::string result,
const std::string& replaceWhat,
const std::string& replaceWithWhat)
const;
174 std::vector<int>
makeUnique(std::vector<int>& vertices)
const;
178 #define MUELU_VISUALIZATIONHELPERS_SHORT void writePVTU(std::ofstream &pvtu, std::string baseFname, int numProcs, bool bFineEdges=false, bool bCoarseEdges=false) const
static void doPointCloud(std::vector< int > &vertices, std::vector< int > &geomSizes, LO numLocalAggs, LO numFineNodes)
void writeFileVTKOpening(std::ofstream &fout, std::vector< int > &uniqueFine, std::vector< int > &geomSizesFine) const
myVec2(double xin, double yin)
virtual ~VisualizationHelpers()
Destructor.
RCP< ParameterList > GetValidParameterList() const
myTriangle(int v1in, int v2in, int v3in)
std::string getPVTUFileName(int numProcs, int myRank, int level, const Teuchos::ParameterList &pL) const
void buildColormap() const
Namespace for MueLu classes and methods.
void writeFileVTKNodes(std::ofstream &fout, std::vector< int > &uniqueFine, Teuchos::RCP< const Map > &nodeMap) const
VisualizationHelpers()
Constructor.
void writeFileVTKCoordinates(std::ofstream &fout, std::vector< int > &uniqueFine, Teuchos::ArrayRCP< const double > &fx, Teuchos::ArrayRCP< const double > &fy, Teuchos::ArrayRCP< const double > &fz, int dim) const
static double pointDistFromTri(myVec3 point, myVec3 v1, myVec3 v2, myVec3 v3)
static double dotProduct(myVec2 v1, myVec2 v2)
Base class providing routines to visualize aggregates and coarsening information. ...
std::vector< int > makeUnique(std::vector< int > &vertices) const
replaces node indices in vertices with compressed unique indices, and returns list of unique points ...
static void doGraphEdges(std::vector< int > &vertices, std::vector< int > &geomSizes, Teuchos::RCP< GraphBase > &G, Teuchos::ArrayRCP< const double > &fx, Teuchos::ArrayRCP< const double > &fy, Teuchos::ArrayRCP< const double > &fz)
std::string replaceAll(std::string result, const std::string &replaceWhat, const std::string &replaceWithWhat) const
static std::vector< int > giftWrap(std::vector< myVec2 > &points, std::vector< int > &nodes, const Teuchos::ArrayRCP< const double > &xCoords, const Teuchos::ArrayRCP< const double > &yCoords)
static void doCGALConvexHulls2D(std::vector< int > &vertices, std::vector< int > &geomSizes, LO numLocalAggs, LO numFineNodes, const std::vector< bool > &isRoot, const ArrayRCP< LO > &vertex2AggId, const Teuchos::ArrayRCP< const double > &xCoords, const Teuchos::ArrayRCP< const double > &yCoords)
static void doJacks(std::vector< int > &vertices, std::vector< int > &geomSizes, LO numLocalAggs, LO numFineNodes, const std::vector< bool > &isRoot, const ArrayRCP< LO > &vertex2AggId)
void writeFileVTKCells(std::ofstream &fout, std::vector< int > &uniqueFine, std::vector< LocalOrdinal > &vertices, std::vector< LocalOrdinal > &geomSize) const
static myVec2 getNorm(myVec2 v)
void writeFileVTKData(std::ofstream &fout, std::vector< int > &uniqueFine, LocalOrdinal myAggOffset, ArrayRCP< LocalOrdinal > &vertex2AggId, int myRank) const
bool operator==(const myTriangle &l)
static myVec3 crossProduct(myVec3 v1, myVec3 v2)
static myVec2 vecSubtract(myVec2 v1, myVec2 v2)
static void doCGALConvexHulls3D(std::vector< int > &vertices, std::vector< int > &geomSizes, LO numLocalAggs, LO numFineNodes, const std::vector< bool > &isRoot, const ArrayRCP< LO > &vertex2AggId, const Teuchos::ArrayRCP< const double > &xCoords, const Teuchos::ArrayRCP< const double > &yCoords, const Teuchos::ArrayRCP< const double > &zCoords)
std::string getFileName(int numProcs, int myRank, int level, const Teuchos::ParameterList &pL) const
void writeFileVTKClosing(std::ofstream &fout) const
static std::vector< myTriangle > processTriangle(std::list< myTriangle > &tris, myTriangle tri, std::list< int > &pointsInFront, myVec3 &barycenter, const Teuchos::ArrayRCP< const double > &xCoords, const Teuchos::ArrayRCP< const double > &yCoords, const Teuchos::ArrayRCP< const double > &zCoords)
static void doConvexHulls3D(std::vector< int > &vertices, std::vector< int > &geomSizes, LO numLocalAggs, LO numFineNodes, const std::vector< bool > &isRoot, const ArrayRCP< LO > &vertex2AggId, const Teuchos::ArrayRCP< const double > &xCoords, const Teuchos::ArrayRCP< const double > &yCoords, const Teuchos::ArrayRCP< const double > &zCoords)
static double distance(myVec2 p1, myVec2 p2)
static bool isInFront(myVec3 point, myVec3 inPlane, myVec3 n)
myVec3(double xin, double yin, double zin)
std::string getBaseFileName(int numProcs, int level, const Teuchos::ParameterList &pL) const
static double mymagnitude(myVec2 vec)
static void doConvexHulls2D(std::vector< int > &vertices, std::vector< int > &geomSizes, LO numLocalAggs, LO numFineNodes, const std::vector< bool > &isRoot, const ArrayRCP< LO > &vertex2AggId, const Teuchos::ArrayRCP< const double > &xCoords, const Teuchos::ArrayRCP< const double > &yCoords)