Commit 04b4060f authored by Dave Moxey's avatar Dave Moxey

Rename MESHGEN and NEKTAR_USE_MESH -> NEKTAR_USE_MESHGEN

parent 5c05d002
......@@ -97,7 +97,7 @@ MARK_AS_ADVANCED(NEKTAR_BUILD_PACKAGES)
OPTION(NEKTAR_TEST_ALL "Include full set of regression tests to this build." OFF)
# Meshing utilities and library
OPTION(NEKTAR_USE_MESH "Build meshing utilities." OFF)
OPTION(NEKTAR_USE_MESHGEN "Build mesh generation utilities." OFF)
# Build options
OPTION(NEKTAR_FULL_DEBUG "Enable Full Debugging." OFF)
......@@ -251,6 +251,10 @@ ELSE( NEKTAR_USE_MEMORY_POOLS )
REMOVE_DEFINITIONS(-DNEKTAR_MEMORY_POOL_ENABLED)
ENDIF( NEKTAR_USE_MEMORY_POOLS )
IF (NEKTAR_USE_MESHGEN)
ADD_DEFINITIONS(-DNEKTAR_USE_MESHGEN)
ENDIF()
SET(Boost_USE_STATIC_LIBS OFF)
IF( WIN32 )
# The auto-linking feature has problems with USE_STATIC_LIBS off, so we use
......
......@@ -6,7 +6,7 @@
#
########################################################################
IF(NEKTAR_USE_MESH)
IF(NEKTAR_USE_MESHGEN)
SET(BUILD_OCC ON)
OPTION(THIRDPARTY_DOWNLOAD_OCC
......@@ -69,4 +69,4 @@ IF(NEKTAR_USE_MESH)
MESSAGE(STATUS "Link to OCC: ${OCC_LIBS}.so")
ENDIF()
ENDIF (THIRDPARTY_DOWNLOAD_OCC)
ENDIF(NEKTAR_USE_MESH)
ENDIF(NEKTAR_USE_MESHGEN)
......@@ -6,56 +6,53 @@
#
########################################################################
IF(NEKTAR_USE_MESH)
SET(BUILD_TETGEN ON)
OPTION(THIRDPARTY_BUILD_TETGEN
"Build TetGen library from ThirdParty." ${BUILD_TETGEN})
IF (THIRDPARTY_BUILD_TETGEN)
INCLUDE(ExternalProject)
EXTERNALPROJECT_ADD(
tetgen-1.5
PREFIX ${TPSRC}
URL http://ae-nektar.ae.ic.ac.uk/~mt4313/tetgen.zip
URL_MD5 6d62e63f9b1e7a8ce53d5bc87e6a0a09
STAMP_DIR ${TPBUILD}/stamp
DOWNLOAD_DIR ${TPSRC}
SOURCE_DIR ${TPSRC}/tetgen-1.5
BINARY_DIR ${TPBUILD}/tetgen-1.5
TMP_DIR ${TPBUILD}/tetgen-1.5-tmp
INSTALL_DIR ${TPDIST}
CONFIGURE_COMMAND ${CMAKE_COMMAND}
-G ${CMAKE_GENERATOR}
-DCMAKE_C_COMPILER:FILEPATH=${CMAKE_C_COMPILER}
-DCMAKE_CXX_COMPILER:FILEPATH=${CMAKE_CXX_COMPILER}
-DCMAKE_INSTALL_PREFIX:PATH=${TPDIST}
${TPSRC}/tetgen-1.5
)
SET(TETGEN_LIBRARY tetgen CACHE FILEPATH
"TetGen library" FORCE)
SET(TETGEN_INCLUDE_DIR ${TPDIST}/include CACHE FILEPATH
"TetGen include" FORCE)
LINK_DIRECTORIES(${TPDIST}/lib)
IF (WIN32)
MESSAGE(STATUS
IF(NEKTAR_USE_MESHGEN)
SET(BUILD_TETGEN ON)
OPTION(THIRDPARTY_BUILD_TETGEN
"Build TetGen library from ThirdParty." ${BUILD_TETGEN})
IF (THIRDPARTY_BUILD_TETGEN)
INCLUDE(ExternalProject)
EXTERNALPROJECT_ADD(
tetgen-1.5
PREFIX ${TPSRC}
URL http://ae-nektar.ae.ic.ac.uk/~mt4313/tetgen.zip
URL_MD5 6d62e63f9b1e7a8ce53d5bc87e6a0a09
STAMP_DIR ${TPBUILD}/stamp
DOWNLOAD_DIR ${TPSRC}
SOURCE_DIR ${TPSRC}/tetgen-1.5
BINARY_DIR ${TPBUILD}/tetgen-1.5
TMP_DIR ${TPBUILD}/tetgen-1.5-tmp
INSTALL_DIR ${TPDIST}
CONFIGURE_COMMAND ${CMAKE_COMMAND}
-G ${CMAKE_GENERATOR}
-DCMAKE_C_COMPILER:FILEPATH=${CMAKE_C_COMPILER}
-DCMAKE_CXX_COMPILER:FILEPATH=${CMAKE_CXX_COMPILER}
-DCMAKE_INSTALL_PREFIX:PATH=${TPDIST}
${TPSRC}/tetgen-1.5
)
SET(TETGEN_LIBRARY tetgen CACHE FILEPATH
"TetGen library" FORCE)
SET(TETGEN_INCLUDE_DIR ${TPDIST}/include CACHE FILEPATH
"TetGen include" FORCE)
LINK_DIRECTORIES(${TPDIST}/lib)
IF (WIN32)
MESSAGE(STATUS
"Build TetGen: ${TPDIST}/${LIB_DIR}/${TETGEN_LIBRARY}.dll")
ELSE ()
MESSAGE(STATUS
ELSE ()
MESSAGE(STATUS
"Build TetGen: ${TPDIST}/${LIB_DIR}/lib${TETGEN_LIBRARY}.a")
ENDIF ()
SET(TETGEN_CONFIG_INCLUDE_DIR ${TPINC})
ELSE()
ADD_CUSTOM_TARGET(tetgen-1.5 ALL)
MESSAGE(STATUS "Found Tetgen: ${TETGEN_LIBRARY}")
SET(TRIANGLE_CONFIG_INCLUDE_DIR ${TETGEN_INCLUDE_DIR})
ENDIF (THIRDPARTY_BUILD_TETGEN)
ENDIF ()
INCLUDE_DIRECTORIES(SYSTEM ${TETGEN_INCLUDE_DIR})
SET(TETGEN_CONFIG_INCLUDE_DIR ${TPINC})
ELSE()
ADD_CUSTOM_TARGET(tetgen-1.5 ALL)
MESSAGE(STATUS "Found Tetgen: ${TETGEN_LIBRARY}")
SET(TRIANGLE_CONFIG_INCLUDE_DIR ${TETGEN_INCLUDE_DIR})
ENDIF (THIRDPARTY_BUILD_TETGEN)
ENDIF(NEKTAR_USE_MESH)
INCLUDE_DIRECTORIES(SYSTEM ${TETGEN_INCLUDE_DIR})
ENDIF(NEKTAR_USE_MESHGEN)
......@@ -6,7 +6,7 @@
#
########################################################################
IF(NEKTAR_USE_MESH)
IF(NEKTAR_USE_MESHGEN)
SET(BUILD_TRIANGLE ON)
OPTION(THIRDPARTY_BUILD_TRIANGLE
......@@ -55,4 +55,4 @@ IF(NEKTAR_USE_MESH)
ENDIF (THIRDPARTY_BUILD_TRIANGLE)
INCLUDE_DIRECTORIES(SYSTEM ${TRIANGLE_INCLUDE_DIR})
ENDIF(NEKTAR_USE_MESH)
ENDIF(NEKTAR_USE_MESHGEN)
......@@ -34,6 +34,7 @@
////////////////////////////////////////////////////////////////////////////////
#include <NekMeshUtils/BLMeshing/BLMesh.h>
#include <NekMeshUtils/CADSystem/CADSurf.h>
using namespace std;
namespace Nektar
......
......@@ -40,7 +40,6 @@
#include <LibUtilities/Memory/NekMemoryManager.hpp>
#include <NekMeshUtils/CADSystem/OpenCascade.h>
#include <NekMeshUtils/MeshElements/MeshElements.h>
namespace Nektar
{
......
......@@ -37,6 +37,10 @@
#include <boost/filesystem.hpp>
#include <NekMeshUtils/CADSystem/CADSystem.h>
#include <NekMeshUtils/CADSystem/CADObj.h>
#include <NekMeshUtils/CADSystem/CADVert.h>
#include <NekMeshUtils/CADSystem/CADCurve.h>
#include <NekMeshUtils/CADSystem/CADSurf.h>
using namespace std;
......
......@@ -42,18 +42,21 @@
#include <LibUtilities/Memory/NekMemoryManager.hpp>
#include <Standard_Macro.hxx>
#include <NekMeshUtils/CADSystem/OpenCascade.h>
#include <NekMeshUtils/CADSystem/CADObj.h>
#include <NekMeshUtils/CADSystem/CADVert.h>
#include <NekMeshUtils/CADSystem/CADCurve.h>
#include <NekMeshUtils/CADSystem/CADSurf.h>
namespace Nektar
{
namespace NekMeshUtils
{
class CADVert;
typedef boost::shared_ptr<CADVert> CADVertSharedPtr;
class CADCurve;
typedef boost::shared_ptr<CADCurve> CADCurveSharedPtr;
class CADSurf;
typedef boost::shared_ptr<CADSurf> CADSurfSharedPtr;
struct EdgeLoop;
/**
* @brief Base class for CAD interface system.
*
......
......@@ -43,7 +43,6 @@
#include <NekMeshUtils/CADSystem/OpenCascade.h>
#include <NekMeshUtils/CADSystem/CADObj.h>
#include <NekMeshUtils/MeshElements/Node.h>
namespace Nektar
......
......@@ -12,7 +12,7 @@ SET(NEKMESHUTILS_SOURCES
MeshElements/Hexahedron.cpp
)
IF(NEKTAR_USE_MESH)
IF(NEKTAR_USE_MESHGEN)
SET(NEKMESHUTILS_SOURCES ${NEKMESHUTILS_SOURCES}
SurfaceMeshing/CurveMesh.cpp
Octree/Octant.cpp
......@@ -49,7 +49,8 @@ SET(NEKMESHUTILS_HEADERS
MeshElements/Prism.h
MeshElements/Hexahedron.h
)
IF(NEKTAR_USE_MESH)
IF(NEKTAR_USE_MESHGEN)
SET(NEKMESHUTILS_HEADERS ${NEKMESHUTILS_HEADERS}
Octree/CurvaturePoint.hpp
SurfaceMeshing/CurveMesh.h
......@@ -79,20 +80,14 @@ ADD_NEKTAR_LIBRARY(NekMeshUtils lib ${NEKTAR_LIBRARY_TYPE}
${NEKMESHUTILS_SOURCES} ${NEKMESHUTILS_HEADERS})
TARGET_LINK_LIBRARIES(NekMeshUtils LINK_PUBLIC SpatialDomains)
IF(NEKTAR_USE_MESH)
IF(NEKTAR_USE_MESHGEN)
TARGET_LINK_LIBRARIES(NekMeshUtils LINK_PRIVATE ${TRIANGLE_LIBRARY})
TARGET_LINK_LIBRARIES(NekMeshUtils LINK_PRIVATE ${TETGEN_LIBRARY})
ENDIF()
IF(NEKTAR_USE_MESH)
SET(OCC_DEF LIN LININTEL HAVE_WOK_CONFIG_H HAVE_CONFIG_H CSFDB)
SET_TARGET_PROPERTIES(NekMeshUtils PROPERTIES COMPILE_DEFINITIONS "${OCC_DEF}")
TARGET_LINK_LIBRARIES(NekMeshUtils LINK_PUBLIC ${OCC_LIBS})
ADD_DEPENDENCIES(NekMeshUtils opencascade-6.8)
ENDIF(NEKTAR_USE_MESH)
IF (NEKTAR_USE_MESH)
SET_TARGET_PROPERTIES(NekMeshUtils PROPERTIES COMPILE_DEFINITIONS "MESHGEN")
ADD_DEPENDENCIES(NekMeshUtils opencascade-6.8 triangle-1.6 tetgen-1.5)
ENDIF()
INSTALL(DIRECTORY ./
......
......@@ -43,14 +43,14 @@
#include <NekMeshUtils/MeshElements/Node.h>
#define TETLIBRARY
#include <tetgen.h>
namespace Nektar
{
namespace NekMeshUtils
{
// Forward declarations
class tetgenio;
/**
* @brief Class for interacting with the external library TetGen.
*/
......
......@@ -35,16 +35,6 @@
#include <NekMeshUtils/ExtLibInterface/TriangleInterface.h>
// horible definitions to get triangle to work
#define REAL double
#define ANSI_DECLARATORS
#define TRILIBRARY
#define VOID int
extern "C" {
#include <triangle.h>
}
#include <sstream>
using namespace std;
......
......@@ -42,14 +42,21 @@
#include <LibUtilities/BasicUtils/SharedArray.hpp>
#include <LibUtilities/Memory/NekMemoryManager.hpp>
// horible definitions to get triangle to work
#define REAL double
#define ANSI_DECLARATORS
#define TRILIBRARY
#define VOID int
extern "C" {
#include <triangle.h>
}
namespace Nektar
{
namespace NekMeshUtils
{
// Forward declarations
struct triangulateio;
/**
* @brief class for interfacing with external library triangle
*/
......@@ -67,8 +74,9 @@ public:
* @brief assign meshing paramters
*/
void Assign(std::vector<std::vector<NodeSharedPtr> > &boundingloops,
std::vector<Array<OneD, NekDouble> > &centers, int i,
NekDouble str = 1.0)
std::vector<Array<OneD, NekDouble> > &centers,
int i,
NekDouble str = 1.0)
{
m_boundingloops = boundingloops;
m_centers = centers;
......@@ -91,7 +99,7 @@ public:
*/
void Extract(std::vector<std::vector<NodeSharedPtr> > &Connec);
private:
private:
/**
* @brief Clear memory
*/
......@@ -100,17 +108,17 @@ public:
/// List of bounding nodes to the surface
std::vector<std::vector<NodeSharedPtr> > m_boundingloops;
/// List of additional nodes
std::vector<NodeSharedPtr> m_stienerpoints;
std::vector<NodeSharedPtr> m_stienerpoints;
/// Coordinates of the centers of the loops
std::vector<Array<OneD, NekDouble> > m_centers;
std::vector<Array<OneD, NekDouble> > m_centers;
/// Map from NekMesh id to triangle id
std::map<int, NodeSharedPtr> nodemap;
std::map<int, NodeSharedPtr> nodemap;
/// ID of the surface
int sid;
int sid;
/// Stretching factor of parameter plane
NekDouble m_str;
NekDouble m_str;
/// Triangle data strucutres
struct triangulateio in, out;
struct triangulateio in, out;
};
typedef boost::shared_ptr<TriangleInterface> TriangleInterfaceSharedPtr;
......
......@@ -69,7 +69,7 @@ public:
: m_n1(pVertex1), m_n2(pVertex2), m_edgeNodes(pEdgeNodes),
m_curveType(pCurveType), m_geom()
{
#ifdef MESHGEN
#ifdef NEKTAR_USE_MESHGEN
onCurve = false;
#endif
}
......@@ -78,7 +78,7 @@ public:
NEKMESHUTILS_EXPORT Edge(NodeSharedPtr pVertex1, NodeSharedPtr pVertex2)
: m_n1(pVertex1), m_n2(pVertex2), m_edgeNodes(), m_curveType(), m_geom()
{
#ifdef MESHGEN
#ifdef NEKTAR_USE_MESHGEN
onCurve = false;
#endif
}
......@@ -182,7 +182,7 @@ public:
/// Element(s) which are linked to this edge.
vector<pair<ElementSharedPtr, int> > m_elLink;
#ifdef MESHGEN
#ifdef NEKTAR_USE_MESHGEN
bool onCurve;
/// id of cad curve which edge lies on
int CADCurveId;
......
......@@ -480,7 +480,7 @@ public:
}
}
#ifdef MESHGEN
#ifdef NEKTAR_USE_MESHGEN
int CADSurfId;
#endif
......
......@@ -38,6 +38,11 @@
#include <NekMeshUtils/NekMeshUtilsDeclspec.h>
#ifdef NEKTAR_USE_MESHGEN
#include <SpatialDomains/PointGeom.h>
#include <NekMeshUtils/CADSystem/CADSystem.h>
#endif
namespace Nektar
{
namespace NekMeshUtils
......@@ -217,7 +222,7 @@ public:
return an;
}
#ifdef MESHGEN // fucntions for cad information
#ifdef NEKTAR_USE_MESHGEN // fucntions for cad information
void SetCADCurve(int i, CADCurveSharedPtr c, NekDouble t)
{
......@@ -310,8 +315,8 @@ public:
/// Z-coordinate.
NekDouble m_z;
#ifdef MESHGEN // tag to tell the meshelemnets to include cad information
#ifdef NEKTAR_USE_MESHGEN // tag to tell the meshelemnets to include cad
// information
/// list of cadcurves the node lies on
std::map<int, std::pair<CADCurveSharedPtr, NekDouble> > CADCurveList;
/// list of cadsurfs the node lies on
......
......@@ -37,6 +37,7 @@
#include <LibUtilities/LinearAlgebra/NekMatrix.hpp>
#include <limits>
#include <set>
using namespace std;
namespace Nektar
......
......@@ -36,6 +36,8 @@
#ifndef NEKTAR_MESHUTILS_OPTIMISATION_OPTIMISEOBJ_H
#define NEKTAR_MESHUTILS_OPTIMISATION_OPTIMISEOBJ_H
#include <LibUtilities/LinearAlgebra/NekTypeDefs.hpp>
namespace Nektar
{
namespace NekMeshUtils
......
......@@ -34,6 +34,7 @@
////////////////////////////////////////////////////////////////////////////////
#include <NekMeshUtils/SurfaceMeshing/OptimiseFunctions.h>
#include <NekMeshUtils/CADSystem/CADCurve.h>
using namespace std;
namespace Nektar
......
......@@ -37,7 +37,8 @@
#define NEKTAR_MESHUTILS_SURFACEMESH_OPTIMISEFUNCTIONS_H
#include <LocalRegions/MatrixKey.h>
#include <NekMeshUtils/CADSystem/CADSystem.h>
#include <NekMeshUtils/CADSystem/CADObj.h>
#include <NekMeshUtils/CADSystem/CADSurf.h>
#include <NekMeshUtils/Optimisation/OptimiseObj.h>
namespace Nektar
......
......@@ -256,9 +256,7 @@ void SurfaceMesh::HOSurf()
LibUtilities::eNodalTriFekete);
Array<OneD, NekDouble> u, v;
int np = LibUtilities::PointsManager()[pkey]->GetTotNumPoints();
int nq = m_mesh->m_nummode;
int ni = (nq - 3) * (nq - 2) / 2;
LibUtilities::PointsManager()[pkey]->GetPoints(u, v);
......@@ -269,8 +267,7 @@ void SurfaceMesh::HOSurf()
EdgeSet completedEdges;
// loop over all the faces in the surface mesh, check all three edges for
// high
// order info, if nothing high-order the edge.
// high order info, if nothing high-order the edge.
for (int i = 0; i < m_mesh->m_element[2].size(); i++)
{
......@@ -489,7 +486,6 @@ void SurfaceMesh::HOSurf()
bool repeat = true;
int itct = 0;
bool hit = false;
while (repeat)
{
NekDouble Norm = 0;
......
......@@ -59,10 +59,10 @@ IF (NEKTAR_USE_VTK)
SET(NekMeshSources ${NekMeshSources} InputModules/InputVtk.cpp OutputModules/OutputVtk.cpp)
ENDIF (NEKTAR_USE_VTK)
IF (NEKTAR_USE_MESH)
IF (NEKTAR_USE_MESHGEN)
SET(NekMeshHeaders ${NekMeshHeaders} InputModules/InputCAD.h)
SET(NekMeshSources ${NekMeshSources} InputModules/InputCAD.cpp)
ENDIF (NEKTAR_USE_MESH)
ENDIF (NEKTAR_USE_MESHGEN)
# Don't use macro -- this way we can just link against NekMeshUtils and
# LocalRegions.
......@@ -89,10 +89,6 @@ IF (NEKTAR_USE_VTK)
ENDIF ()
ENDIF (NEKTAR_USE_VTK)
IF (NEKTAR_USE_MESH)
SET_TARGET_PROPERTIES(NekMesh PROPERTIES COMPILE_DEFINITIONS "MESHGEN")
ENDIF()
# Nektar++
ADD_NEKTAR_TEST (Nektar++/InvalidTetFace)
# Gmsh tests
......
......@@ -193,7 +193,8 @@ void Module::ProcessEdges(bool ReprocessEdges)
e2->m_edgeNodes.end());
}
}
#ifdef MESHGEN
#ifdef NEKTAR_USE_MESHGEN
if(ed->onCurve)
{
e2->onCurve = ed->onCurve;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment