Skip to content
Snippets Groups Projects
Commit 774bf81b authored by Soeren Peters's avatar Soeren Peters
Browse files

- broken stl discretization!!

parent 3d930878
No related branches found
No related tags found
No related merge requests found
Showing
with 1157 additions and 631 deletions
build/
.vscode/
MSVC2017/
VS2017/
#include "TriangularMeshStrategy.h"
#include "../Triangle/Triangle.h"
#include "TriangularMesh.h"
#include "grid/GridImp.h"
#include "numerics/geometry3d/GbTriFaceMesh3D.h"
#include "grid/NodeValues.h"
void TriangularMeshDiscretizationStrategy::removeOddBoundaryCellNodes(GridImp* grid)
{
#pragma omp parallel for
for (uint index = 0; index < grid->getSize(); index++)
grid->removeOddBoundaryCellNode(index);
}
void PointInObjectDiscretizationStrategy::doDiscretize(TriangularMesh* triangularMesh, GridImp* grid, char InnerType, char OuterType)
{
auto mesh = triangularMesh->getGbTriFaceMesh3D();
for (uint i = 0; i < grid->getSize(); i++)
{
real x, y, z;
grid->transIndexToCoords(i, x, y, z);
if (mesh->isPointInGbObject3D(x, y, z))
grid->setNodeTo(i, InnerType);
//else
// grid->setNodeTo(i, OuterType);
}
delete mesh;
}
void RayCastingDiscretizationStrategy::doDiscretize(TriangularMesh* triangularMesh, GridImp* grid, char InnerType, char OuterType)
{
// auto mesh = triangularMesh->getGbTriFaceMesh3D();
// const real minXExact = triangularMesh->minmax.minX;
// const real minYExact = triangularMesh->minmax.minY;
// const real minZExact = triangularMesh->minmax.minZ;
// const real maxXExact = triangularMesh->minmax.maxX;
// const real maxYExact = triangularMesh->minmax.maxY;
// const real maxZExact = triangularMesh->minmax.maxZ;
// const auto min = grid->getMinimumOnNode(Vertex(minXExact, minYExact, minZExact));
// const real minX = min.x;
// const real minY = min.y;
// const real minZ = min.z;
// const auto max = grid->getMaximumOnNode(Vertex(maxXExact, maxYExact, maxZExact));
// const real maxX = max.x;
// const real maxY = max.y;
// const real maxZ = max.z;
// real x, y, z;
// for (z = minZ; z <= maxZ; z += grid->getDelta())
// {
// for (y = minY; y <= maxY; y += grid->getDelta())
// {
// for (x = minX; x <= maxX; x += grid->getDelta())
// {
// grid->setNodeTo(grid->transCoordToIndex(x, y, z), InnerType);
// }
// }
// }
// int counter = 0;
// // Test line intersection
// for (z = minZ; z <= maxZ; z += grid->getDelta())
// {
// for (y = minY; y <= maxY; y += grid->getDelta())
// {
// for (x = minX; x <= maxX; x += grid->getDelta())
// {
// counter++;
// if (mesh->intersectLine((x - grid->getDelta()), y, z, x, y, z))
// break;
// grid->setNodeTo(grid->transCoordToIndex(x, y, z), OuterType);
// }
// }
// }
// // Test line intersection from opposite direction
// for (z = minZ; z <= maxZ; z += grid->getDelta())
// {
// for (y = minY; y <= maxY; y += grid->getDelta())
// {
// for (x = maxX; x >= minX; x -= grid->getDelta())
// {
// if (!grid->isNode(grid->transCoordToIndex(x, y, z), OuterType))
// {
// counter++;
// if (mesh->intersectLine((x + grid->getDelta()), y, z, x, y, z))
// break;
// grid->setNodeTo(grid->transCoordToIndex(x, y, z), OuterType);
// }
// }
// }
// }
// // Test line intersection
// for (z = minZ; z <= maxZ; z += grid->getDelta())
// {
// for (x = minX; x <= maxX; x += grid->getDelta())
// {
// for (y = minY; y <= maxY; y += grid->getDelta())
// {
// if (!grid->isNode(grid->transCoordToIndex(x, y, z), OuterType))
// {
// counter++;
// if (mesh->intersectLine(x, (y - grid->getDelta()), z, x, y, z))
// break;
// grid->setNodeTo(grid->transCoordToIndex(x, y, z), OuterType);
// }
// }
// }
// }
// // Test line intersection from opposite direction
// for (z = minZ; z <= maxZ; z += grid->getDelta())
// {
// for (x = minX; x <= maxX; x += grid->getDelta())
// {
// for (y = maxY; y >= minY; y -= grid->getDelta())
// {
// if (!grid->isNode(grid->transCoordToIndex(x, y, z), OuterType))
// {
// counter++;
// if (mesh->intersectLine(x, (y + grid->getDelta()), z, x, y, z))
// break;
// grid->setNodeTo(grid->transCoordToIndex(x, y, z), OuterType);
// }
// }
// }
// }
// // Test line intersection
// for (x = minX; x <= maxX; x += grid->getDelta())
// {
// for (y = minY; y <= maxY; y += grid->getDelta())
// {
// for (z = minZ; z <= maxZ; z += grid->getDelta())
// {
// if (!grid->isNode(grid->transCoordToIndex(x, y, z), OuterType))
// {
// counter++;
// if (mesh->intersectLine(x, y, (z - grid->getDelta()), x, y, z))
// break;
// grid->setNodeTo(grid->transCoordToIndex(x, y, z), OuterType);
// }
// }
// }
// }
// // Test line intersection from opposite direction
// for (x = minX; x <= maxX; x += grid->getDelta())
// {
// for (y = minY; y <= maxY; y += grid->getDelta())
// {
// for (z = maxZ; z >= minZ; z -= grid->getDelta())
// {
// if (!grid->isNode(grid->transCoordToIndex(x, y, z), OuterType))
// {
// counter++;
// if (mesh->intersectLine(x, y, (z + grid->getDelta()), x, y, z))
// break;
// grid->setNodeTo(grid->transCoordToIndex(x, y, z), OuterType);
// }
// }
// }
// }
// delete mesh;
}
void PointUnderTriangleStrategy::doDiscretize(TriangularMesh* triangularMesh, GridImp* grid, char innerType, char outerType)
{
#pragma omp parallel for
for (long i = 0; i < triangularMesh->size; i++)
this->meshReverse(triangularMesh->triangles[i], grid, innerType);
this->findInsideNodes(grid, innerType);
#pragma omp parallel for
for (uint i = 0; i < grid->getSize(); i++)
this->setNegativeDirBorderTo(grid, i, innerType);
}
void PointUnderTriangleStrategy::meshReverse(Triangle& triangle, GridImp* grid, char innerType)
{
auto box = grid->getBoundingBoxOnNodes(triangle);
const real delta = grid->getDelta();
triangle.initalLayerThickness(delta);
for (real x = box.minX; x <= box.maxX; x += delta)
{
for (real y = box.minY; y <= box.maxY; y += delta)
{
for (real z = box.minZ; z <= box.maxZ; z += delta)
{
const uint index = grid->transCoordToIndex(x, y, z);
const Vertex point(x, y, z);
const char pointValue = triangle.isUnderFace(point);
if (pointValue == NEGATIVE_DIRECTION_BORDER)
grid->setNodeTo(index, NEGATIVE_DIRECTION_BORDER);
else if (pointValue == INSIDE)
grid->setNodeTo(index, innerType);
}
}
}
}
HOSTDEVICE void PointUnderTriangleStrategy::findInsideNodes(GridImp* grid, char innerType)
{
bool foundInsideNode = true;
while (foundInsideNode)
{
foundInsideNode = false;
for (uint index = 0; index < grid->getSize(); index++)
this->setInsideNode(grid, index, foundInsideNode, innerType);
}
}
HOSTDEVICE void PointUnderTriangleStrategy::setInsideNode(GridImp* grid, const uint &index, bool &insideNodeFound, char innerType)
{
if (grid->isNode(index, NEGATIVE_DIRECTION_BORDER))
return;
if (!grid->isNode(index, innerType) && grid->nodeInNextCellIs(index, innerType))
{
grid->setNodeTo(index, innerType);
insideNodeFound = true;
}
}
HOSTDEVICE void PointUnderTriangleStrategy::setNegativeDirBorderTo(GridImp* grid, const uint &index, char innerType)
{
if (grid->isNode(index, NEGATIVE_DIRECTION_BORDER))
grid->setNodeTo(index, innerType);
}
\ No newline at end of file
......@@ -3,15 +3,13 @@
#include "GridGenerator/global.h"
#include "../Triangle/Triangle.h"
#include "TriangularMesh.h"
#include "numerics/geometry3d/GbTriFaceMesh3D.h"
#include "grid/GridImp.h"
#include "utilities/logger/Logger.h"
#include "grid/NodeValues.h"
#include "VirtualFluidsDefinitions.h"
class GridImp;
class TriangularMesh;
struct Triangle;
class TriangularMeshDiscretizationStrategy
class VF_PUBLIC TriangularMeshDiscretizationStrategy
{
public:
TriangularMeshDiscretizationStrategy() {}
......@@ -26,274 +24,44 @@ public:
private:
virtual void doDiscretize(TriangularMesh* triangularMesh, GridImp* grid, char InnerType, char OuterType) = 0;
void removeOddBoundaryCellNodes(GridImp* grid)
{
#pragma omp parallel for
for (uint index = 0; index < grid->getSize(); index++)
grid->removeOddBoundaryCellNode(index);
}
void removeOddBoundaryCellNodes(GridImp* grid);
};
class PointInObjectDiscretizationStrategy : public TriangularMeshDiscretizationStrategy
class VF_PUBLIC PointInObjectDiscretizationStrategy : public TriangularMeshDiscretizationStrategy
{
public:
PointInObjectDiscretizationStrategy() {}
virtual ~PointInObjectDiscretizationStrategy() {}
virtual void doDiscretize(TriangularMesh* triangularMesh, GridImp* grid, char InnerType, char OuterType)
{
auto mesh = triangularMesh->getGbTriFaceMesh3D();
for (uint i = 0; i < grid->getSize(); i++)
{
real x, y, z;
grid->transIndexToCoords(i, x, y, z);
if (mesh->isPointInGbObject3D(x, y, z))
grid->setNodeTo(i, InnerType);
//else
// grid->setNodeTo(i, OuterType);
}
delete mesh;
}
virtual void doDiscretize(TriangularMesh* triangularMesh, GridImp* grid, char InnerType, char OuterType);
};
class RayCastingDiscretizationStrategy : public TriangularMeshDiscretizationStrategy
class VF_PUBLIC RayCastingDiscretizationStrategy : public TriangularMeshDiscretizationStrategy
{
public:
RayCastingDiscretizationStrategy() {}
virtual ~RayCastingDiscretizationStrategy() {}
virtual void doDiscretize(TriangularMesh* triangularMesh, GridImp* grid, char InnerType, char OuterType)
{
auto mesh = triangularMesh->getGbTriFaceMesh3D();
const real minXExact = triangularMesh->minmax.minX;
const real minYExact = triangularMesh->minmax.minY;
const real minZExact = triangularMesh->minmax.minZ;
const real maxXExact = triangularMesh->minmax.maxX;
const real maxYExact = triangularMesh->minmax.maxY;
const real maxZExact = triangularMesh->minmax.maxZ;
const auto min = grid->getMinimumOnNode(Vertex(minXExact, minYExact, minZExact));
const real minX = min.x;
const real minY = min.y;
const real minZ = min.z;
const auto max = grid->getMaximumOnNode(Vertex(maxXExact, maxYExact, maxZExact));
const real maxX = max.x;
const real maxY = max.y;
const real maxZ = max.z;
real x, y, z;
for (z = minZ; z <= maxZ; z += grid->getDelta())
{
for (y = minY; y <= maxY; y += grid->getDelta())
{
for (x = minX; x <= maxX; x += grid->getDelta())
{
grid->setNodeTo(grid->transCoordToIndex(x, y, z), InnerType);
}
}
}
int counter = 0;
// Test line intersection
for (z = minZ; z <= maxZ; z += grid->getDelta())
{
for (y = minY; y <= maxY; y += grid->getDelta())
{
for (x = minX; x <= maxX; x += grid->getDelta())
{
counter++;
if (mesh->intersectLine((x - grid->getDelta()), y, z, x, y, z))
break;
grid->setNodeTo(grid->transCoordToIndex(x, y, z), OuterType);
}
}
}
// Test line intersection from opposite direction
for (z = minZ; z <= maxZ; z += grid->getDelta())
{
for (y = minY; y <= maxY; y += grid->getDelta())
{
for (x = maxX; x >= minX; x -= grid->getDelta())
{
if (!grid->isNode(grid->transCoordToIndex(x, y, z), OuterType))
{
counter++;
if (mesh->intersectLine((x + grid->getDelta()), y, z, x, y, z))
break;
grid->setNodeTo(grid->transCoordToIndex(x, y, z), OuterType);
}
}
}
}
// Test line intersection
for (z = minZ; z <= maxZ; z += grid->getDelta())
{
for (x = minX; x <= maxX; x += grid->getDelta())
{
for (y = minY; y <= maxY; y += grid->getDelta())
{
if (!grid->isNode(grid->transCoordToIndex(x, y, z), OuterType))
{
counter++;
if (mesh->intersectLine(x, (y - grid->getDelta()), z, x, y, z))
break;
grid->setNodeTo(grid->transCoordToIndex(x, y, z), OuterType);
}
}
}
}
// Test line intersection from opposite direction
for (z = minZ; z <= maxZ; z += grid->getDelta())
{
for (x = minX; x <= maxX; x += grid->getDelta())
{
for (y = maxY; y >= minY; y -= grid->getDelta())
{
if (!grid->isNode(grid->transCoordToIndex(x, y, z), OuterType))
{
counter++;
if (mesh->intersectLine(x, (y + grid->getDelta()), z, x, y, z))
break;
grid->setNodeTo(grid->transCoordToIndex(x, y, z), OuterType);
}
}
}
}
// Test line intersection
for (x = minX; x <= maxX; x += grid->getDelta())
{
for (y = minY; y <= maxY; y += grid->getDelta())
{
for (z = minZ; z <= maxZ; z += grid->getDelta())
{
if (!grid->isNode(grid->transCoordToIndex(x, y, z), OuterType))
{
counter++;
if (mesh->intersectLine(x, y, (z - grid->getDelta()), x, y, z))
break;
grid->setNodeTo(grid->transCoordToIndex(x, y, z), OuterType);
}
}
}
}
// Test line intersection from opposite direction
for (x = minX; x <= maxX; x += grid->getDelta())
{
for (y = minY; y <= maxY; y += grid->getDelta())
{
for (z = maxZ; z >= minZ; z -= grid->getDelta())
{
if (!grid->isNode(grid->transCoordToIndex(x, y, z), OuterType))
{
counter++;
if (mesh->intersectLine(x, y, (z + grid->getDelta()), x, y, z))
break;
grid->setNodeTo(grid->transCoordToIndex(x, y, z), OuterType);
}
}
}
}
delete mesh;
}
virtual void RayCastingDiscretizationStrategy::doDiscretize(TriangularMesh* triangularMesh, GridImp* grid, char InnerType, char OuterType);
};
class PointUnderTriangleStrategy : public TriangularMeshDiscretizationStrategy
class VF_PUBLIC PointUnderTriangleStrategy : public TriangularMeshDiscretizationStrategy
{
public:
PointUnderTriangleStrategy() {}
virtual ~PointUnderTriangleStrategy() {}
void doDiscretize(TriangularMesh* triangularMesh, GridImp* grid, char innerType, char outerType) override
{
#pragma omp parallel for
for (long i = 0; i < triangularMesh->size; i++)
this->meshReverse(triangularMesh->triangles[i], grid, innerType);
this->findInsideNodes(grid, innerType);
#pragma omp parallel for
for (uint i = 0; i < grid->getSize(); i++)
this->setNegativeDirBorderTo(grid, i, innerType);
}
void doDiscretize(TriangularMesh* triangularMesh, GridImp* grid, char innerType, char outerType) override;
private:
HOSTDEVICE void meshReverse(Triangle &triangle, GridImp* grid, char innerType)
{
auto box = grid->getBoundingBoxOnNodes(triangle);
const real delta = grid->getDelta();
triangle.initalLayerThickness(delta);
HOSTDEVICE void meshReverse(Triangle& triangle, GridImp* grid, char innerType);
for (real x = box.minX; x <= box.maxX; x += delta)
{
for (real y = box.minY; y <= box.maxY; y += delta)
{
for (real z = box.minZ; z <= box.maxZ; z += delta)
{
const uint index = grid->transCoordToIndex(x, y, z);
HOSTDEVICE void findInsideNodes(GridImp* grid, char innerType);
const Vertex point(x, y, z);
HOSTDEVICE void setInsideNode(GridImp* grid, const uint &index, bool &insideNodeFound, char innerType);
const char pointValue = triangle.isUnderFace(point);
if (pointValue == NEGATIVE_DIRECTION_BORDER)
grid->setNodeTo(index, NEGATIVE_DIRECTION_BORDER);
else if (pointValue == INSIDE)
grid->setNodeTo(index, innerType);
}
}
}
}
HOSTDEVICE void findInsideNodes(GridImp* grid, char innerType)
{
bool foundInsideNode = true;
while (foundInsideNode)
{
foundInsideNode = false;
for (uint index = 0; index < grid->getSize(); index++)
this->setInsideNode(grid, index, foundInsideNode, innerType);
}
}
HOSTDEVICE void setInsideNode(GridImp* grid, const uint &index, bool &insideNodeFound, char innerType)
{
if (grid->isNode(index, NEGATIVE_DIRECTION_BORDER))
return;
if (!grid->isNode(index, innerType) && grid->nodeInNextCellIs(index, innerType))
{
grid->setNodeTo(index, innerType);
insideNodeFound = true;
}
}
HOSTDEVICE void setNegativeDirBorderTo(GridImp* grid, const uint &index, char innerType)
{
if (grid->isNode(index, NEGATIVE_DIRECTION_BORDER))
grid->setNodeTo(index, innerType);
}
HOSTDEVICE void setNegativeDirBorderTo(GridImp* grid, const uint &index, char innerType);
};
......
#include "MultipleGridBuilder.h"
#include <sstream>
#include "utilities/math/Math.h"
#include "../Grid.h"
#include "../GridFactory.h"
......
......@@ -15,8 +15,6 @@
#include "grid/NodeValues.h"
#include "grid/GridInterface.h"
#include "io/GridVTKWriter/GridVTKWriter.h"
#include "numerics/geometry3d/GbTriFaceMesh3D.h"
void GridCpuStrategy::allocateGridMemory(SPtr<GridImp> grid)
{
......
......@@ -10,18 +10,23 @@
#include <sstream>
#include <iostream>
#include <vector>
#include <map>
#include <VirtualFluidsDefinitions.h>
#ifdef CAB_RCF
#include <3rdParty/rcf/RcfSerializationIncludes.h>
#endif //CAB_RCF
#include <basics/utilities/UbException.h>
#include <basics/utilities/UbMath.h>
#include <basics/utilities/Vector3D.h>
#include <basics/writer/WbWriter.h>
#include <basics/memory/MbSmartPtr.h>
#include "basics/utilities/Vector3D.h"
#include "GbObject3D.h"
#include <numerics/geometry3d/GbPoint3D.h>
#include <VirtualFluidsDefinitions.h>
class WbWriter;
namespace Kd
{
......@@ -30,9 +35,6 @@ namespace Kd
template< typename T > class RayIntersectionHandler;
}
//RayCrossing Test ...
//http://orion.math.iastate.edu/burkardt/c_src/orourke/inhedron.c
/*=========================================================================*/
/* GbTriFaceMesh3D */
......@@ -75,7 +77,7 @@ public:
}
bool operator== (const Vertex& rhs)
{
return ( fabs(x-rhs.x)<1.E-10 && fabs(y-rhs.y)<1.E-10 && fabs(z-rhs.z)<1.E-10 );
return ( fabs(x-rhs.x)<1.E-8 && fabs(y-rhs.y)<1.E-8 && fabs(z-rhs.z)<1.E-8 );
}
friend inline bool operator<(const Vertex & lhsVert,const Vertex & rhsVert)
{
......@@ -96,12 +98,6 @@ public:
return(new Vertex(this));
}
template<class Archive>
void serialize(Archive & ar, const unsigned int version)
{
ar & x & y & z;
}
#ifdef CAB_RCF
template<class Archive>
void SF_SERIALIZE(Archive & ar)
......@@ -189,12 +185,12 @@ public:
//GbVector3D AC = C-A;
//GbVector3D N = AB.Cross(AC);
//return 0.5*N.Length();
Vector3D A(nodes[v1].x, nodes[v1].y, nodes[v1].z);
Vector3D B(nodes[v2].x, nodes[v2].y, nodes[v2].z);
Vector3D C(nodes[v3].x, nodes[v3].y, nodes[v3].z);
Vector3D AB = B - A;
Vector3D AC = C - A;
Vector3D N = AB.Cross(AC);
Vector3D A(nodes[v1].x, nodes[v1].y, nodes[v1].z);
Vector3D B(nodes[v2].x, nodes[v2].y, nodes[v2].z);
Vector3D C(nodes[v3].x, nodes[v3].y, nodes[v3].z);
Vector3D AB = B-A;
Vector3D AC = C-A;
Vector3D N = AB.Cross(AC);
return 0.5*N.Length();
}
void calculateNormal(std::vector<Vertex>& nodes)
......@@ -222,13 +218,6 @@ public:
<<"->removeRedunantNodes"<<std::endl;
}
}
template<class Archive>
void serialize(Archive & ar, const unsigned int version)
{
ar & v1 & v2 & v3;
}
#ifdef CAB_RCF
template<class Archive>
void SF_SERIALIZE(Archive & ar)
......@@ -243,14 +232,14 @@ public:
};
public:
enum KDTREE_SPLITAGORITHM { KDTREE_SHAPLIT, KDTREE_SPATIALSPLIT };
enum KDTREE_SPLITAGORITHM { KDTREE_SAHPLIT, KDTREE_SPATIALSPLIT };
public:
GbTriFaceMesh3D();
GbTriFaceMesh3D(std::string name, std::vector<Vertex>* nodes, std::vector<TriFace>* triangles, KDTREE_SPLITAGORITHM splitAlg = KDTREE_SHAPLIT, bool removeRedundantNodes=true);
GbTriFaceMesh3D(std::string name, std::vector<Vertex>* nodes, std::vector<TriFace>* triangles, KDTREE_SPLITAGORITHM splitAlg = KDTREE_SAHPLIT, bool removeRedundantNodes=true);
~GbTriFaceMesh3D();
GbTriFaceMesh3D* clone() { throw UbException(UB_EXARGS,"not implemented"); }
GbTriFaceMesh3D* clone();// { throw UbException(UB_EXARGS,"not implemented"); }
void finalize() {}
//void setRegardPointInPolyhedronTest(bool value) { this->regardPiO=value; }
......@@ -260,6 +249,16 @@ public:
//std::string getName();
std::vector<Vertex>* getNodes();
std::vector<TriFace>* getTriangles();
void setTransferViaFilename(bool transferViaFilename, std::string filename, double transX1, double transX2, double transX3)
{
this->filename = filename;
this->transferViaFilename = transferViaFilename;
this->transX1 = transX1;
this->transX2 = transX2;
this->transX3 = transX3;
}
void readMeshFromSTLFile(std::string filename, bool removeRedundantNodes);
double getX1Minimum() { if(!this->consistent) this->calculateValues(); return this->x1min; }
double getX1Maximum() { if(!this->consistent) this->calculateValues(); return this->x1max; }
......@@ -274,7 +273,6 @@ public:
double getX3Maximum() { if(!this->consistent) this->calculateValues(); return this->x3max; }
void calculateValues();
void generateKdTree();
double getVolume();
void deleteRedundantNodes();
......@@ -282,13 +280,17 @@ public:
UbTupleDouble6 calculateMomentOfInertia(double rhoP);
UbTupleDouble3 calculateCenterOfGravity();
void transform(const double matrix[4][4]);
void rotate(const double& alpha, const double& beta, const double& gamma);
void setCenterCoordinates(const double& x1, const double& x2, const double& x3);
void scale(const double& sx1, const double& sx2, const double& sx3);
void rotate(const double& alpha, const double& beta, const double& gamma);
void rotateAroundPoint(const double& px1, const double& px2, const double& px3, const double& alpha, const double& beta, const double& gamma);
void translate(const double& x1, const double& x2, const double& x3);
void reflectAcrossXYLine(const double& alpha);
bool isPointInGbObject3D(const double& x1, const double& x2, const double& x3);
bool isPointInGbObject3D(const double& x1, const double& x2, const double& x3, int counter);
bool isPointInGbObject3D(const double& x1, const double& x2, const double& x3, bool& pointIsOnBoundary);
virtual GbLine3D* createClippedLine3D (GbPoint3D &point1,GbPoint3D &point2);
......@@ -298,16 +300,7 @@ public:
std::vector<GbTriFaceMesh3D::TriFace*> getTrianglesForVertex(Vertex* vertex);
void setKdTreeSplitAlgorithm(KDTREE_SPLITAGORITHM mode)
{
this->kdtreeSplitAlg = mode;
bool rebuild = (mode != kdtreeSplitAlg);
if( ( rebuild || !kdTree)
&& ( kdtreeSplitAlg == KDTREE_SHAPLIT || kdtreeSplitAlg == KDTREE_SPATIALSPLIT ) )
{
this->calculateValues();
}
}
void setKdTreeSplitAlgorithm(KDTREE_SPLITAGORITHM mode);
KDTREE_SPLITAGORITHM getKdTreeSplitAlgorithm() { return this->kdtreeSplitAlg; }
Kd::Tree<double>* getKdTree() { return this->kdTree; }
......@@ -317,20 +310,36 @@ public:
void read(UbFileInput* in);
virtual UbTuple<std::string, std::string> writeMesh(std::string filename, WbWriter* writer, bool writeNormals=false, std::vector< std::string >* datanames=NULL, std::vector< std::vector < double > >* nodedata=NULL );
void writeMeshPly( const std::string& filename);
/*======================================================================*/
using GbObject3D::isPointInGbObject3D; //Grund: dadurch muss man hier isPointInGbObject3D(GbPoint3D*) nicht ausprogrammieren, welche sonst hier "ueberdeckt" waere
bool intersectLine(const double& p1_x1, const double& p1_x2, const double& p1_x3, const double& p2_x1, const double& p2_x2, const double& p2_x3);
#ifdef CAB_RCF
template<class Archive>
void SF_SERIALIZE(Archive & ar)
{
SF_SERIALIZE_PARENT<GbObject3D>(ar, *this);
ar & kdtreeSplitAlg;
ar & nodes;
ar & triangles;
ar & transferViaFilename;
if(!transferViaFilename)
{
ar & nodes;
ar & triangles;
}
else
{
ar & filename;
ar & transX1;
ar & transX2;
ar & transX3;
if(ArchiveTools::isReading(ar) )
{
this->readMeshFromSTLFile(filename, true);
this->translate(transX1,transX2,transX3);
}
}
if(ArchiveTools::isReading(ar)) this->calculateValues();
}
#endif //CAB_RCF
......@@ -341,6 +350,12 @@ protected:
std::vector<Vertex>* nodes;
std::vector<TriFace>* triangles;
//for transfer
std::string filename;
bool transferViaFilename;
double transX1;
double transX2;
double transX3;
double x1min;
double x1max;
......@@ -353,7 +368,6 @@ protected:
double x3center;
bool consistent;
bool kdTreeValid;
bool buildVertTriRelationMap;
std::multimap<Vertex*,TriFace*> relationVertTris;
......
......@@ -20,6 +20,8 @@ GbTriFaceMesh3D* GbTriFaceMesh3DCreator::readMeshFromFile(string filename, strin
//in "kleinbuchstaben" umwandeln
transform(ext.begin(), ext.end(), ext.begin(), (int(*)(int))tolower); //(int(*)(int)) ist irgendso ein fieser cast, weil tolower ne alte c-methode ist
//UBLOG(logINFO, "GbTriFaceMesh3DCreator::readMeshFromFile - read " <<filename );
if ( !ext.compare("ply" ) ) return GbTriFaceMesh3DCreator::readMeshFromPLYFile(filename, meshName,splitAlg , removeRedundantNodes);
else if( !ext.compare("stl" ) ) return GbTriFaceMesh3DCreator::readMeshFromSTLFile(filename, meshName,splitAlg , removeRedundantNodes);
else if( !ext.compare("inp" ) ) return GbTriFaceMesh3DCreator::readMeshFromAVSFile(filename, meshName,splitAlg , removeRedundantNodes);
......@@ -50,7 +52,7 @@ GbTriFaceMesh3D* GbTriFaceMesh3DCreator::readMeshFromMeshFile(UbFileInput* in, s
}
int numVertices = in->readInteger();
UBLOG(logINFO,"Number of vertices "<<numVertices);
UBLOG(logDEBUG1,"Number of vertices "<<numVertices);
nodes->resize(numVertices);
......@@ -63,7 +65,7 @@ GbTriFaceMesh3D* GbTriFaceMesh3DCreator::readMeshFromMeshFile(UbFileInput* in, s
in->readLine();
(*nodes)[i] = GbTriFaceMesh3D::Vertex(x,y,z);
}
UBLOG(logINFO," - read vertices (#"<<numVertices<<") done");
UBLOG(logDEBUG1," - read vertices (#"<<numVertices<<") done");
while( !in->eof() )
{
......@@ -73,7 +75,7 @@ GbTriFaceMesh3D* GbTriFaceMesh3DCreator::readMeshFromMeshFile(UbFileInput* in, s
}
int numFaces = in->readInteger();
triangles->reserve(numFaces);
UBLOG(logINFO,"Number of faces "<<numFaces);
UBLOG(logDEBUG1,"Number of faces "<<numFaces);
int j,k,l;
for(int i=0; i<numFaces; i++)
......@@ -85,7 +87,7 @@ GbTriFaceMesh3D* GbTriFaceMesh3DCreator::readMeshFromMeshFile(UbFileInput* in, s
(*triangles).push_back(GbTriFaceMesh3D::TriFace(j,k,l));
}
UBLOG(logINFO," - read faces (#"<<(int)triangles->size()<<", #nonTriangles="<<(int)triangles->size()-numFaces<<") done");
UBLOG(logDEBUG1," - read faces (#"<<(int)triangles->size()<<", #nonTriangles="<<(int)triangles->size()-numFaces<<") done");
GbTriFaceMesh3D* mesh = new GbTriFaceMesh3D(meshName, nodes, triangles, splitAlg, removeRedundantNodes );
......@@ -112,8 +114,8 @@ GbTriFaceMesh3D* GbTriFaceMesh3DCreator::readMeshFromPLYFile(UbFileInput* in, st
int numFaces = in->readIntegerAfterString("element face");
in->setPosAfterLineWithString("end_header");
UBLOG(logINFO,"Number of vertices "<<numVertices);
UBLOG(logINFO,"Number of faces "<<numFaces);
UBLOG(logDEBUG1,"Number of vertices "<<numVertices);
UBLOG(logDEBUG1,"Number of faces "<<numFaces);
nodes->resize(numVertices);
triangles->reserve(numFaces);
......@@ -129,7 +131,7 @@ GbTriFaceMesh3D* GbTriFaceMesh3DCreator::readMeshFromPLYFile(UbFileInput* in, st
in->readLine();
(*nodes)[i] = GbTriFaceMesh3D::Vertex(x,y,z);
}
UBLOG(logINFO," - read vertices (#"<<numVertices<<") done");
UBLOG(logDEBUG1," - read vertices (#"<<numVertices<<") done");
int p,j,k,l,n;
onePercent = (int)UbMath::max(1,UbMath::integerRounding(numFaces*0.01));
......@@ -176,7 +178,7 @@ GbTriFaceMesh3D* GbTriFaceMesh3DCreator::readMeshFromPLYFile(UbFileInput* in, st
in->readLine();
}
UBLOG(logINFO," - read faces (#"<<(int)triangles->size()<<", #nonTriangles="<<(int)triangles->size()-numFaces<<") done");
UBLOG(logDEBUG1," - read faces (#"<<(int)triangles->size()<<", #nonTriangles="<<(int)triangles->size()-numFaces<<") done");
GbTriFaceMesh3D* mesh = new GbTriFaceMesh3D(meshName, nodes, triangles, splitAlg, removeRedundantNodes);
......@@ -192,7 +194,7 @@ GbTriFaceMesh3D* GbTriFaceMesh3DCreator::readMeshFromSTLFile(string filename, st
/*======================================================================*/
GbTriFaceMesh3D* GbTriFaceMesh3DCreator::readMeshFromSTLFile(UbFileInput *in, string meshName, GbTriFaceMesh3D::KDTREE_SPLITAGORITHM splitAlg, bool removeRedundantNodes)
{
UBLOG(logINFO,"GbTriFaceMesh3DCreator::readMeshFromSTLFile !!! Dieses Format hat leider redundante Knoten ...");
UBLOG(logDEBUG1,"GbTriFaceMesh3DCreator::readMeshFromSTLFile !!! Dieses Format hat leider redundante Knoten ...");
vector<GbTriFaceMesh3D::Vertex> *nodes = new vector<GbTriFaceMesh3D::Vertex>;
vector<GbTriFaceMesh3D::TriFace> *triangles = new vector<GbTriFaceMesh3D::TriFace>;
......@@ -230,119 +232,89 @@ GbTriFaceMesh3D* GbTriFaceMesh3DCreator::readMeshFromSTLFile(UbFileInput *in, st
in->readLine();
dummy = in->readString();
nr+=3;
//std::cout<<"read mesh "<< nr <<" \n";
}
GbTriFaceMesh3D* mesh = new GbTriFaceMesh3D(meshName, nodes, triangles, splitAlg, removeRedundantNodes);
return mesh;
}
// /*======================================================================*/
// GbTriFaceMesh3D* GbTriFaceMesh3DCreator::readMeshFromMeshFile(string filename, string meshName, bool removeRedundantNodes)
// {
// public static void read(String file, ArrayList<Node3d> nodeList, ArrayList<TrianglePatch> patches) throws FileReaderException {
//
// UBLOG(logINFO,"GbTriFaceMesh3DCreator::readMeshFromSTLFile !!! Dieses Format hat leider redundante Knoten ...");
//
// vector<GbTriFaceMesh3D::Vertex> *nodes = new vector<GbTriFaceMesh3D::Vertex>;
// vector<GbTriFaceMesh3D::TriFace> *triangles = new vector<GbTriFaceMesh3D::TriFace>;
// string dummy;
//
// double x, y, z;
// int nr=0;
//
// in->readLine();
// while(dummy!="endsolid")
// {
// in->readLine();
// in->readLine();
// dummy = in->readString();
// if(dummy!="vertex") throw UbException(UB_EXARGS,"no vertex format");
// x=in->readDouble();
// y=in->readDouble();
// z=in->readDouble();
// nodes->push_back(GbTriFaceMesh3D::Vertex((float)x,(float)y,(float)z));
// in->readLine();
// in->readString();
// x=in->readDouble();
// y=in->readDouble();
// z=in->readDouble();
// nodes->push_back(GbTriFaceMesh3D::Vertex((float)x,(float)y,(float)z));
// in->readLine();
// in->readString();
// x=in->readDouble();
// y=in->readDouble();
// z=in->readDouble();
// nodes->push_back(GbTriFaceMesh3D::Vertex((float)x,(float)y,(float)z));
// triangles->push_back(GbTriFaceMesh3D::TriFace(nr,nr+1,nr+2));
// in->readLine();
// in->readLine();
// in->readLine();
// dummy = in->readString();
// nr+=3;
// }
//
//
// GbTriFaceMesh3D* mesh = new GbTriFaceMesh3D(meshName, nodes, triangles, splitAlg, removeRedundantNodes);
//
// return mesh;
//
//
// try {
//
// FileInput input = new FileInput(file);
//
// int line = 0;
// while(true)
// {
// if(line>1000) break;
// if(input.readLine().contains("Vertices"))
// break;
// line++;
// }
//
// int num_of_points = input.readInt();
//
// for (int i = 0; i < num_of_points; i++) {
// float x = (float) input.readDouble();
// float y = (float) input.readDouble();
// float z = (float) input.readDouble();
// int nr = input.readInt();
// nodeList.add(new Node3d(x, y, z));
// }
//
// input.skipLine();
// input.skipLine();
// int num_of_triangles = input.readInt();
//
// for (int i = 0; i < num_of_triangles; i++) {
//
// int a = input.readInt();
// int b = input.readInt();
// int c = input.readInt();
// int nr = input.readInt();
//
// Node3d P1 = nodeList.get(a - 1);
// Node3d P2 = nodeList.get(b - 1);
// Node3d P3 = nodeList.get(c - 1);
//
// patches.add(new TrianglePatch(P1, P2, P3));
// }
//
// // END reading mesh file
// }
//
// --
//
// Dipl.-Ing. Sebastian Bindick
//
// Institute for Computational Modeling in Civil Engineering (iRMB) Technische Universitt Braunschweig Pockelsstr. 3 (9th Floor) D-38106, Braunschweig, Germany
//
// phone +49 531/391-7598
// fax +49 531/391-7599
// email bindick@irmb.tu-bs.de
// web www.irmb.tu-bs.de
//
//
//////////////////////////////////////////////////////////////////////////
GbTriFaceMesh3D* GbTriFaceMesh3DCreator::readMeshFromSTLFile2(string filename, string meshName, GbTriFaceMesh3D::KDTREE_SPLITAGORITHM splitAlg, bool removeRedundantNodes, bool isBinaryFormat)
{
vector<GbTriFaceMesh3D::Vertex> *nodes = new vector<GbTriFaceMesh3D::Vertex>;
vector<GbTriFaceMesh3D::TriFace> *triangles = new vector<GbTriFaceMesh3D::TriFace>;
int nr=0;
if (!isBinaryFormat) {
ifstream in(filename.c_str());
if (!in.good())
{
delete nodes;
delete triangles;
UB_THROW(UbException(UB_EXARGS, "Can not open STL file: "+filename));
}
char title[80];
std::string s0, s1;
float n0, n1, n2, f0, f1, f2, f3, f4, f5, f6, f7, f8;
in.read(title, 80);
while (!in.eof()) {
in >> s0; // facet || endsolid
if (s0=="facet") {
in >> s1 >> n0 >> n1 >> n2; // normal x y z
in >> s0 >> s1; // outer loop
in >> s0 >> f0 >> f1 >> f2; // vertex x y z
in >> s0 >> f3 >> f4 >> f5; // vertex x y z
in >> s0 >> f6 >> f7 >> f8; // vertex x y z
in >> s0; // endloop
in >> s0; // endfacet
// Generate a new Triangle without Normal as 3 Vertices
nodes->push_back(GbTriFaceMesh3D::Vertex(f0, f1, f2));
nodes->push_back(GbTriFaceMesh3D::Vertex(f3, f4, f5));
nodes->push_back(GbTriFaceMesh3D::Vertex(f6, f7, f8));
triangles->push_back(GbTriFaceMesh3D::TriFace(nr,nr+1,nr+2));
nr+=3;
}
else if (s0=="endsolid") {
break;
}
}
in.close();
}
else {
FILE *f = fopen(filename.c_str(), "rb");
if (!f)
{
delete nodes;
delete triangles;
UB_THROW(UbException(UB_EXARGS, "Can not open STL file: "+filename));
}
char title[80];
int nFaces;
fread(title, 80, 1, f);
fread((void*)&nFaces, 4, 1, f);
float v[12]; // normal=3, vertices=3*3 = 12
unsigned short uint16;
// Every Face is 50 Bytes: Normal(3*float), Vertices(9*float), 2 Bytes Spacer
for (size_t i=0; i<nFaces; ++i) {
for (size_t j=0; j<12; ++j) {
fread((void*)&v[j], sizeof(float), 1, f);
}
fread((void*)&uint16, sizeof(unsigned short), 1, f); // spacer between successive faces
nodes->push_back(GbTriFaceMesh3D::Vertex(v[3], v[4], v[5]));
nodes->push_back(GbTriFaceMesh3D::Vertex(v[6], v[7], v[8]));
nodes->push_back(GbTriFaceMesh3D::Vertex(v[9], v[10], v[11]));
triangles->push_back(GbTriFaceMesh3D::TriFace(nr, nr+1, nr+2));
nr+=3;
}
fclose(f);
}
GbTriFaceMesh3D* mesh = new GbTriFaceMesh3D(meshName, nodes, triangles, splitAlg, removeRedundantNodes);
return mesh;
}
/*======================================================================*/
GbTriFaceMesh3D* GbTriFaceMesh3DCreator::readMeshFromAVSFile(string filename, string meshName, GbTriFaceMesh3D::KDTREE_SPLITAGORITHM splitAlg, bool removeRedundantNodes)
{
......@@ -353,7 +325,7 @@ GbTriFaceMesh3D* GbTriFaceMesh3DCreator::readMeshFromAVSFile(string filename, st
/*======================================================================*/
GbTriFaceMesh3D* GbTriFaceMesh3DCreator::readMeshFromAVSFile(UbFileInput *in, string meshName, GbTriFaceMesh3D::KDTREE_SPLITAGORITHM splitAlg , bool removeRedundantNodes)
{
UBLOG(logINFO,"GbTriFaceMesh3DCreator.readMeshFromAVSFile !!! Dieses Format hat leider redundante Knoten ...");
UBLOG(logDEBUG1,"GbTriFaceMesh3DCreator.readMeshFromAVSFile !!! Dieses Format hat leider redundante Knoten ...");
vector<GbTriFaceMesh3D::Vertex> *nodes = new vector<GbTriFaceMesh3D::Vertex>;
vector<GbTriFaceMesh3D::TriFace> *triangles = new vector<GbTriFaceMesh3D::TriFace>;
......@@ -400,7 +372,7 @@ GbTriFaceMesh3D* GbTriFaceMesh3DCreator::readMeshFromVTKASCIIFile(string filenam
/*======================================================================*/
GbTriFaceMesh3D* GbTriFaceMesh3DCreator::readMeshFromVTKASCIIFile(UbFileInput *in, string meshName, GbTriFaceMesh3D::KDTREE_SPLITAGORITHM splitAlg, bool removeRedundantNodes)
{
UBLOG(logINFO,"GbTriFaceMesh3DCreator.readMeshFromVTKASCIIFile !!! Dieses Format hat leider redundante Knoten ...");
UBLOG(logDEBUG1,"GbTriFaceMesh3DCreator.readMeshFromVTKASCIIFile !!! Dieses Format hat leider redundante Knoten ...");
vector<GbTriFaceMesh3D::Vertex> *nodes = new vector<GbTriFaceMesh3D::Vertex>;
vector<GbTriFaceMesh3D::TriFace> *triangles = new vector<GbTriFaceMesh3D::TriFace>;
......@@ -437,7 +409,7 @@ GbTriFaceMesh3D* GbTriFaceMesh3DCreator::readMeshFromVTKASCIIFile(UbFileInput *i
in->readString();
int numberTris = in->readInteger();
in->readLine();
UBLOG(logINFO,"numberTris:"<<numberTris);
UBLOG(logDEBUG1,"numberTris:"<<numberTris);
int id1,id2,id3;
for(int u=0;u<numberTris;u++)
......@@ -449,10 +421,10 @@ GbTriFaceMesh3D* GbTriFaceMesh3DCreator::readMeshFromVTKASCIIFile(UbFileInput *i
triangles->push_back(GbTriFaceMesh3D::TriFace(id1,id2,id3));
//cout<<u<<" - id1,id2,id3:"<<id1<<","<<id2<<","<<id3<<endl;
}
UBLOG(logINFO,"Tris gelesen");
UBLOG(logDEBUG1,"Tris gelesen");
GbTriFaceMesh3D* mesh = new GbTriFaceMesh3D(meshName, nodes, triangles, splitAlg, removeRedundantNodes);
UBLOG(logINFO,"mesh erzeugt (with remove redundant nodes = "<< boolalpha <<removeRedundantNodes<<")");
UBLOG(logDEBUG1,"mesh erzeugt (with remove redundant nodes = "<< boolalpha <<removeRedundantNodes<<")");
return mesh;
......
......@@ -21,22 +21,23 @@ public:
static GbTriFaceMesh3DCreator instance;
return &instance;
}
static GbTriFaceMesh3D* readMeshFromFile(std::string filename, std::string meshName, GbTriFaceMesh3D::KDTREE_SPLITAGORITHM splitAlg = GbTriFaceMesh3D::KDTREE_SHAPLIT, bool removeRedundantNodes=true);
static GbTriFaceMesh3D* readMeshFromFile(std::string filename, std::string meshName="", GbTriFaceMesh3D::KDTREE_SPLITAGORITHM splitAlg = GbTriFaceMesh3D::KDTREE_SAHPLIT, bool removeRedundantNodes=true);
static GbTriFaceMesh3D* readMeshFromMeshFile(std::string filename, std::string meshName, GbTriFaceMesh3D::KDTREE_SPLITAGORITHM splitAlg = GbTriFaceMesh3D::KDTREE_SHAPLIT, bool removeRedundantNodes=true);
static GbTriFaceMesh3D* readMeshFromMeshFile(UbFileInput* in, std::string meshName, GbTriFaceMesh3D::KDTREE_SPLITAGORITHM splitAlg = GbTriFaceMesh3D::KDTREE_SHAPLIT, bool removeRedundantNodes=true);
static GbTriFaceMesh3D* readMeshFromMeshFile(std::string filename, std::string meshName="", GbTriFaceMesh3D::KDTREE_SPLITAGORITHM splitAlg = GbTriFaceMesh3D::KDTREE_SAHPLIT, bool removeRedundantNodes=true);
static GbTriFaceMesh3D* readMeshFromMeshFile(UbFileInput* in, std::string meshName="", GbTriFaceMesh3D::KDTREE_SPLITAGORITHM splitAlg = GbTriFaceMesh3D::KDTREE_SAHPLIT, bool removeRedundantNodes=true);
static GbTriFaceMesh3D* readMeshFromPLYFile(std::string filename, std::string meshName, GbTriFaceMesh3D::KDTREE_SPLITAGORITHM splitAlg = GbTriFaceMesh3D::KDTREE_SHAPLIT, bool removeRedundantNodes=true);
static GbTriFaceMesh3D* readMeshFromPLYFile(UbFileInput* in, std::string meshName, GbTriFaceMesh3D::KDTREE_SPLITAGORITHM splitAlg = GbTriFaceMesh3D::KDTREE_SHAPLIT, bool removeRedundantNodes=true);
static GbTriFaceMesh3D* readMeshFromPLYFile(std::string filename, std::string meshName="", GbTriFaceMesh3D::KDTREE_SPLITAGORITHM splitAlg = GbTriFaceMesh3D::KDTREE_SAHPLIT, bool removeRedundantNodes=true);
static GbTriFaceMesh3D* readMeshFromPLYFile(UbFileInput* in, std::string meshName="", GbTriFaceMesh3D::KDTREE_SPLITAGORITHM splitAlg = GbTriFaceMesh3D::KDTREE_SAHPLIT, bool removeRedundantNodes=true);
static GbTriFaceMesh3D* readMeshFromSTLFile(std::string filename, std::string meshName, GbTriFaceMesh3D::KDTREE_SPLITAGORITHM splitAlg = GbTriFaceMesh3D::KDTREE_SHAPLIT, bool removeRedundantNodes=true);
static GbTriFaceMesh3D* readMeshFromSTLFile(UbFileInput* in, std::string meshName, GbTriFaceMesh3D::KDTREE_SPLITAGORITHM splitAlg = GbTriFaceMesh3D::KDTREE_SHAPLIT, bool removeRedundantNodes=true);
static GbTriFaceMesh3D* readMeshFromSTLFile(std::string filename, std::string meshName="", GbTriFaceMesh3D::KDTREE_SPLITAGORITHM splitAlg = GbTriFaceMesh3D::KDTREE_SAHPLIT, bool removeRedundantNodes=true);
static GbTriFaceMesh3D* readMeshFromSTLFile(UbFileInput* in, std::string meshName="", GbTriFaceMesh3D::KDTREE_SPLITAGORITHM splitAlg = GbTriFaceMesh3D::KDTREE_SAHPLIT, bool removeRedundantNodes=true);
static GbTriFaceMesh3D* readMeshFromSTLFile2(std::string filename, std::string meshName="", GbTriFaceMesh3D::KDTREE_SPLITAGORITHM splitAlg = GbTriFaceMesh3D::KDTREE_SAHPLIT, bool removeRedundantNodes=true, bool isBinaryFormat=true);
static GbTriFaceMesh3D* readMeshFromAVSFile(std::string filename, std::string meshName, GbTriFaceMesh3D::KDTREE_SPLITAGORITHM splitAlg = GbTriFaceMesh3D::KDTREE_SHAPLIT, bool removeRedundantNodes=true);
static GbTriFaceMesh3D* readMeshFromAVSFile(UbFileInput* in, std::string meshName, GbTriFaceMesh3D::KDTREE_SPLITAGORITHM splitAlg = GbTriFaceMesh3D::KDTREE_SHAPLIT, bool removeRedundantNodes=true);
static GbTriFaceMesh3D* readMeshFromAVSFile(std::string filename, std::string meshName="", GbTriFaceMesh3D::KDTREE_SPLITAGORITHM splitAlg = GbTriFaceMesh3D::KDTREE_SAHPLIT, bool removeRedundantNodes=true);
static GbTriFaceMesh3D* readMeshFromAVSFile(UbFileInput* in, std::string meshName="", GbTriFaceMesh3D::KDTREE_SPLITAGORITHM splitAlg = GbTriFaceMesh3D::KDTREE_SAHPLIT, bool removeRedundantNodes=true);
static GbTriFaceMesh3D* readMeshFromVTKASCIIFile(std::string filename, std::string meshName, GbTriFaceMesh3D::KDTREE_SPLITAGORITHM splitAlg = GbTriFaceMesh3D::KDTREE_SHAPLIT, bool removeRedundantNodes=true);
static GbTriFaceMesh3D* readMeshFromVTKASCIIFile(UbFileInput* in, std::string meshName, GbTriFaceMesh3D::KDTREE_SPLITAGORITHM splitAlg = GbTriFaceMesh3D::KDTREE_SHAPLIT, bool removeRedundantNodes=true);
static GbTriFaceMesh3D* readMeshFromVTKASCIIFile(std::string filename, std::string meshName="", GbTriFaceMesh3D::KDTREE_SPLITAGORITHM splitAlg = GbTriFaceMesh3D::KDTREE_SAHPLIT, bool removeRedundantNodes=true);
static GbTriFaceMesh3D* readMeshFromVTKASCIIFile(UbFileInput* in, std::string meshName="", GbTriFaceMesh3D::KDTREE_SPLITAGORITHM splitAlg = GbTriFaceMesh3D::KDTREE_SAHPLIT, bool removeRedundantNodes=true);
GbTriFaceMesh3D* createGbObject3D() { return new GbTriFaceMesh3D(); }
......
......@@ -10,9 +10,9 @@ logging::LoggerImp::LoggerImp(std::ostream* stream) : logging::Logger(stream)
{
levelString[Level::WARNING] = "[WARNING]";
levelString[Level::ERROR] = "[ERROR]";
levelString[Level::INFO_LOW] = "[LOW]";
levelString[Level::INFO_INTERMEDIATE] = "[INTERMEDIATE]";
levelString[Level::INFO_HIGH] = "[HIGH]";
levelString[Level::INFO_LOW] = "[INFO_LOW]";
levelString[Level::INFO_INTERMEDIATE] = "[INFO_INTERMEDIATE]";
levelString[Level::INFO_HIGH] = "[INFO_HIGH]";
}
logging::LoggerImp::~LoggerImp()
......
......@@ -249,7 +249,7 @@ void multipleLevel(const std::string& configPath)
auto gridFactory = SPtr<GridFactory>(new GridFactory());
gridFactory->setGridStrategy(SPtr<GridStrategy>(new GridCpuStrategy()));
gridFactory->setGrid("grid");
gridFactory->setTriangularMeshDiscretizationMethod(TriangularMeshDiscretizationMethod::RAYCASTING);
gridFactory->setTriangularMeshDiscretizationMethod(TriangularMeshDiscretizationMethod::POINT_IN_OBJECT);
//auto gridBuilderlevel = LevelGridBuilder::makeShared(Device::CPU, "D3Q27");
auto gridBuilder = MultipleGridBuilder::makeShared(gridFactory);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment