Skip to content
Snippets Groups Projects
Commit 278ebae5 authored by Andrew Heather's avatar Andrew Heather
Browse files

COMP: Initial updates for integration into OpenFOAM

parent 4c98ca6f
No related branches found
No related tags found
No related merge requests found
...@@ -14,10 +14,6 @@ ifeq (OpenFOAM,$(findstring OpenFOAM,$(WM_PROJECT))) ...@@ -14,10 +14,6 @@ ifeq (OpenFOAM,$(findstring OpenFOAM,$(WM_PROJECT)))
endif endif
endif endif
ifeq (v, $(findstring v, $(WM_PROJECT_VERSION)))
CFMESH_MACROS += -DOpenCFDSpecific
endif
ifeq ($(WM_PROJECT), foam) ifeq ($(WM_PROJECT), foam)
VER := $(shell expr `echo $(WM_PROJECT_VERSION)` \>= 3.2) VER := $(shell expr `echo $(WM_PROJECT_VERSION)` \>= 3.2)
ifeq ($(VER), 1) ifeq ($(VER), 1)
......
...@@ -52,11 +52,7 @@ void quadricFitting::calculateNormalVector() ...@@ -52,11 +52,7 @@ void quadricFitting::calculateNormalVector()
//- estimate the normal as the eigenvector associated //- estimate the normal as the eigenvector associated
//- to the smallest eigenvalue //- to the smallest eigenvalue
# ifdef OpenCFDSpecific
normal_ = eigenVectors(mat, ev).x(); normal_ = eigenVectors(mat, ev).x();
# else
normal_ = eigenVector(mat, ev[0]);
# endif
} }
void quadricFitting::calculateCoordinateSystem() void quadricFitting::calculateCoordinateSystem()
......
...@@ -495,11 +495,7 @@ void tetMeshOptimisation::optimiseBoundaryVolumeOptimizer ...@@ -495,11 +495,7 @@ void tetMeshOptimisation::optimiseBoundaryVolumeOptimizer
if( mag(ev[2]) > (mag(ev[1]) + mag(ev[0])) ) if( mag(ev[2]) > (mag(ev[1]) + mag(ev[0])) )
{ {
//- ordinary surface vertex //- ordinary surface vertex
# ifdef OpenCFDSpecific
vector normal = eigenVectors(nt, ev).z(); vector normal = eigenVectors(nt, ev).z();
# else
vector normal = eigenVector(nt, ev[2]);
# endif
normal /= (mag(normal)+VSMALL); normal /= (mag(normal)+VSMALL);
disp -= (disp & normal) * normal; disp -= (disp & normal) * normal;
...@@ -507,19 +503,11 @@ void tetMeshOptimisation::optimiseBoundaryVolumeOptimizer ...@@ -507,19 +503,11 @@ void tetMeshOptimisation::optimiseBoundaryVolumeOptimizer
else if( mag(ev[1]) > 0.5 * (mag(ev[2]) + mag(ev[0])) ) else if( mag(ev[1]) > 0.5 * (mag(ev[2]) + mag(ev[0])) )
{ {
//- this vertex is on an edge //- this vertex is on an edge
# ifdef OpenCFDSpecific
vector normal1 = eigenVectors(nt, ev).y(); vector normal1 = eigenVectors(nt, ev).y();
# else
vector normal1 = eigenVector(nt, ev[1]);
# endif
normal1 /= (mag(normal1)+VSMALL); normal1 /= (mag(normal1)+VSMALL);
# ifdef OpenCFDSpecific
vector normal2 = eigenVectors(nt, ev).z(); vector normal2 = eigenVectors(nt, ev).z();
# else
vector normal2 = eigenVector(nt, ev[2]);
# endif
normal2 /= (mag(normal2)+VSMALL); normal2 /= (mag(normal2)+VSMALL);
......
...@@ -86,19 +86,11 @@ bool triSurface2DCheck::is2DSurface() const ...@@ -86,19 +86,11 @@ bool triSurface2DCheck::is2DSurface() const
//- calculate the plane normal as a cross prduct of the two //- calculate the plane normal as a cross prduct of the two
//- eigenVectors spanning the plane //- eigenVectors spanning the plane
# ifdef OpenCFDSpecific
const vector n const vector n
( (
eigenVectors(covarianceMatrix_, eigenVal).y() ^ eigenVectors(covarianceMatrix_, eigenVal).y() ^
eigenVectors(covarianceMatrix_, eigenVal).z() eigenVectors(covarianceMatrix_, eigenVal).z()
); );
# else
const vector n
(
eigenVector(covarianceMatrix_, eigenVal[1]) ^
eigenVector(covarianceMatrix_, eigenVal[2])
);
# endif
//- check if the plane is in the x-y plane of the coordinate system //- check if the plane is in the x-y plane of the coordinate system
if( mag(n.x()) > SMALL || mag(n.y()) > SMALL ) if( mag(n.x()) > SMALL || mag(n.y()) > SMALL )
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment