mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
COMP: surfaceFeatureExtract: Clean up build
This commit is contained in:
@ -3,30 +3,25 @@ cd ${0%/*} || exit 1 # run from this directory
|
|||||||
|
|
||||||
set -x
|
set -x
|
||||||
|
|
||||||
if [ ! -e "Make/files" ] || [ ! -e "Make/options" ]
|
if [ -n "$CGAL_ARCH_PATH" ]
|
||||||
then
|
then
|
||||||
mkdir -p Make
|
|
||||||
|
|
||||||
if [ -n "$CGAL_ARCH_PATH" ]
|
|
||||||
then
|
|
||||||
cp -r MakeWithCGAL/* Make
|
|
||||||
|
|
||||||
echo
|
echo
|
||||||
echo Compiling surfaceFeatureExtract with CGAL support for curvature
|
echo "Compiling surfaceFeatureExtract with CGAL curvature support"
|
||||||
echo
|
echo
|
||||||
|
|
||||||
wmake
|
wmake "ENABLE_CURVATURE=-DENABLE_CURVATURE \
|
||||||
else
|
EXE_FROUNDING_MATH=-frounding-math \
|
||||||
cp -r MakeWithoutCGAL/* Make
|
USE_F2C=-DCGAL_USE_F2C \
|
||||||
|
CGAL_LIBDIR=-L$CGAL_ARCH_PATH/lib \
|
||||||
echo
|
LAPACK_LIB=-llapack \
|
||||||
echo Compiling surfaceFeatureExtract without CGAL support for curvature
|
BLAS_LIB=-lblas \
|
||||||
echo
|
CGAL_LIB=-lCGAL"
|
||||||
|
|
||||||
wmake
|
|
||||||
fi
|
|
||||||
else
|
else
|
||||||
echo surfaceFeatureExtract already has a Make folder
|
echo
|
||||||
|
echo "Compiling surfaceFeatureExtract without CGAL curvature support"
|
||||||
|
echo
|
||||||
|
|
||||||
|
wmake
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -1,89 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration |
|
|
||||||
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
|
|
||||||
\\/ M anipulation |
|
|
||||||
-------------------------------------------------------------------------------
|
|
||||||
License
|
|
||||||
This file is part of OpenFOAM.
|
|
||||||
|
|
||||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
|
||||||
under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#include "buildCGALPolyhedron.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::buildCGALPolyhedron::buildCGALPolyhedron
|
|
||||||
(
|
|
||||||
const Foam::triSurface& surf
|
|
||||||
)
|
|
||||||
:
|
|
||||||
CGAL::Modifier_base<HalfedgeDS>(),
|
|
||||||
surf_(surf)
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::buildCGALPolyhedron::~buildCGALPolyhedron()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
void Foam::buildCGALPolyhedron::operator()
|
|
||||||
(
|
|
||||||
HalfedgeDS& hds
|
|
||||||
)
|
|
||||||
{
|
|
||||||
typedef HalfedgeDS::Traits Traits;
|
|
||||||
typedef Traits::Point_3 Point;
|
|
||||||
|
|
||||||
// Postcondition: `hds' is a valid polyhedral surface.
|
|
||||||
CGAL::Polyhedron_incremental_builder_3<HalfedgeDS> B(hds, false);
|
|
||||||
|
|
||||||
B.begin_surface
|
|
||||||
(
|
|
||||||
surf_.points().size(), // n points
|
|
||||||
surf_.size(), // n facets
|
|
||||||
2*surf_.edges().size() // n halfedges
|
|
||||||
);
|
|
||||||
|
|
||||||
forAll(surf_.points(), pI)
|
|
||||||
{
|
|
||||||
const Foam::point& p = surf_.points()[pI];
|
|
||||||
|
|
||||||
B.add_vertex(Point(p.x(), p.y(), p.z()));
|
|
||||||
}
|
|
||||||
|
|
||||||
forAll(surf_, fI)
|
|
||||||
{
|
|
||||||
B.begin_facet();
|
|
||||||
|
|
||||||
B.add_vertex_to_facet(surf_[fI][0]);
|
|
||||||
B.add_vertex_to_facet(surf_[fI][1]);
|
|
||||||
B.add_vertex_to_facet(surf_[fI][2]);
|
|
||||||
|
|
||||||
B.end_facet();
|
|
||||||
}
|
|
||||||
|
|
||||||
B.end_surface();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -80,18 +80,56 @@ public:
|
|||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
//- Construct with reference to triSurface
|
//- Construct with reference to triSurface
|
||||||
buildCGALPolyhedron(const triSurface& surf);
|
explicit buildCGALPolyhedron(const triSurface& surf)
|
||||||
|
:
|
||||||
|
CGAL::Modifier_base<HalfedgeDS>(),
|
||||||
|
surf_(surf)
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
//- Destructor
|
//- Destructor
|
||||||
~buildCGALPolyhedron();
|
~buildCGALPolyhedron(){}
|
||||||
|
|
||||||
|
|
||||||
// Member Operators
|
// Member Operators
|
||||||
|
|
||||||
//- operator() of this `modifier' called by delegate function of
|
//- operator() of this `modifier' called by delegate function of
|
||||||
// Polyhedron
|
// Polyhedron
|
||||||
void operator()(HalfedgeDS& hds);
|
void operator()(HalfedgeDS& hds)
|
||||||
|
{
|
||||||
|
typedef HalfedgeDS::Traits Traits;
|
||||||
|
typedef Traits::Point_3 Point;
|
||||||
|
|
||||||
|
// Postcondition: `hds' is a valid polyhedral surface.
|
||||||
|
CGAL::Polyhedron_incremental_builder_3<HalfedgeDS> B(hds, false);
|
||||||
|
|
||||||
|
B.begin_surface
|
||||||
|
(
|
||||||
|
surf_.points().size(), // n points
|
||||||
|
surf_.size(), // n facets
|
||||||
|
2*surf_.edges().size() // n halfedges
|
||||||
|
);
|
||||||
|
|
||||||
|
forAll(surf_.points(), pI)
|
||||||
|
{
|
||||||
|
const Foam::point& p = surf_.points()[pI];
|
||||||
|
|
||||||
|
B.add_vertex(Point(p.x(), p.y(), p.z()));
|
||||||
|
}
|
||||||
|
|
||||||
|
forAll(surf_, fI)
|
||||||
|
{
|
||||||
|
B.begin_facet();
|
||||||
|
|
||||||
|
B.add_vertex_to_facet(surf_[fI][0]);
|
||||||
|
B.add_vertex_to_facet(surf_[fI][1]);
|
||||||
|
B.add_vertex_to_facet(surf_[fI][2]);
|
||||||
|
|
||||||
|
B.end_facet();
|
||||||
|
}
|
||||||
|
|
||||||
|
B.end_surface();
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -1,4 +1,11 @@
|
|||||||
|
include $(GENERAL_RULES)/CGAL
|
||||||
|
|
||||||
EXE_INC = \
|
EXE_INC = \
|
||||||
|
${ENABLE_CURVATURE}\
|
||||||
|
${EXE_FROUNDING_MATH} \
|
||||||
|
${USE_F2C} \
|
||||||
|
${CGAL_INC} \
|
||||||
|
-ICGALPolyhedron \
|
||||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||||
-I$(LIB_SRC)/edgeMesh/lnInclude \
|
-I$(LIB_SRC)/edgeMesh/lnInclude \
|
||||||
@ -7,6 +14,11 @@ EXE_INC = \
|
|||||||
-I$(LIB_SRC)/sampling/lnInclude
|
-I$(LIB_SRC)/sampling/lnInclude
|
||||||
|
|
||||||
EXE_LIBS = \
|
EXE_LIBS = \
|
||||||
|
$(CGAL_LIBS) \
|
||||||
|
${CGAL_LIBDIR} \
|
||||||
|
${LAPACK_LIB} \
|
||||||
|
${BLAS_LIB} \
|
||||||
|
${CGAL_LIB} \
|
||||||
-lmeshTools \
|
-lmeshTools \
|
||||||
-ledgeMesh \
|
-ledgeMesh \
|
||||||
-ltriSurface \
|
-ltriSurface \
|
||||||
|
|||||||
@ -1,4 +0,0 @@
|
|||||||
surfaceFeatureExtract.C
|
|
||||||
CGALPolyhedron/buildCGALPolyhedron.C
|
|
||||||
|
|
||||||
EXE = $(FOAM_APPBIN)/surfaceFeatureExtract
|
|
||||||
@ -1,29 +0,0 @@
|
|||||||
EXE_FROUNDING_MATH = -frounding-math
|
|
||||||
EXE_NDEBUG = -DNDEBUG
|
|
||||||
USE_F2C = -DCGAL_USE_F2C
|
|
||||||
include $(GENERAL_RULES)/CGAL
|
|
||||||
|
|
||||||
EXE_INC = \
|
|
||||||
-DENABLE_CURVATURE \
|
|
||||||
${EXE_FROUNDING_MATH} \
|
|
||||||
${EXE_NDEBUG} \
|
|
||||||
${USE_F2C} \
|
|
||||||
${CGAL_INC} \
|
|
||||||
-ICGALPolyhedron \
|
|
||||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
|
||||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
|
||||||
-I$(LIB_SRC)/edgeMesh/lnInclude \
|
|
||||||
-I$(LIB_SRC)/triSurface/lnInclude \
|
|
||||||
-I$(LIB_SRC)/surfMesh/lnInclude \
|
|
||||||
-I$(LIB_SRC)/sampling/lnInclude
|
|
||||||
|
|
||||||
EXE_LIBS = \
|
|
||||||
$(CGAL_LIBS) \
|
|
||||||
-L$(CGAL_ARCH_PATH)/lib \
|
|
||||||
-llapack \
|
|
||||||
-lblas \
|
|
||||||
-lCGAL \
|
|
||||||
-lmeshTools \
|
|
||||||
-ledgeMesh \
|
|
||||||
-ltriSurface \
|
|
||||||
-lsampling
|
|
||||||
@ -1,3 +0,0 @@
|
|||||||
surfaceFeatureExtract.C
|
|
||||||
|
|
||||||
EXE = $(FOAM_APPBIN)/surfaceFeatureExtract
|
|
||||||
@ -1,13 +0,0 @@
|
|||||||
EXE_INC = \
|
|
||||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
|
||||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
|
||||||
-I$(LIB_SRC)/edgeMesh/lnInclude \
|
|
||||||
-I$(LIB_SRC)/triSurface/lnInclude \
|
|
||||||
-I$(LIB_SRC)/surfMesh/lnInclude \
|
|
||||||
-I$(LIB_SRC)/sampling/lnInclude
|
|
||||||
|
|
||||||
EXE_LIBS = \
|
|
||||||
-lmeshTools \
|
|
||||||
-ledgeMesh \
|
|
||||||
-ltriSurface \
|
|
||||||
-lsampling
|
|
||||||
Reference in New Issue
Block a user