Commit eb8eab36 authored by Michael Turner's avatar Michael Turner

Merge branch 'feature/CMake_CCMIO' into 'master'

Thirdparty compilation of libccmio

See merge request !799
parents 067613a8 a0da8882
......@@ -13,8 +13,10 @@ v5.0.0
- Add periodic boundary condition meshing in 2D (!733)
- Adjust boundary layer thickness in corners in 2D (!739)
- Add non-O BL meshing in 2D (!757)
- Add ability to compile CCIO library but tar file is not yet openly
available whist we seek permission from Simens (!799)
- Fix issue with reading CCM files due to definition of default arrays
- rather than a vector (!797)
rather than a vector (!797)
- Fix inverted triangles and small memory issue in surface meshing (!798)
**Library**
......
......@@ -6,28 +6,76 @@
#
########################################################################
OPTION(NEKTAR_USE_CCM
"CCM star i/o library is available." OFF)
"use CCM star i/o" OFF)
IF( NEKTAR_USE_CCM )
# First search for system ccmioL installs. Hint /usr/local
FIND_PATH (CCMIO_INCLUDE_DIR ccmio.h PATHS /usr/local/include)
FIND_LIBRARY(CCMIO_LIBRARY NAMES "ccmio" PATHS /usr/local/lib)
# If we have our library then don't build CCMIO.
IF (CCMIO_INCLUDE_DIR AND CCMIO_LIBRARY)
SET(BUILD_CCMIO OFF)
ELSE()
SET(BUILD_CCMIO ON)
ENDIF ()
OPTION(THIRDPARTY_BUILD_CCMIO
"Build CCMIO library from ThirdParty if permitted." ${BUILD_CCMIO})
IF (THIRDPARTY_BUILD_CCMIO)
INCLUDE(ExternalProject)
MESSAGE(WARNING "We are seeking permission to distribute ccmio with Nektar++. If you are entitled to use libccmio please contact nektar-users@imperial.ac.uk and place the file ccmio-2.06.tar.bz2 in the director $NEKTAR/ThirdParty")
EXTERNALPROJECT_ADD(
ccmio-2.06
PREFIX ${TPSRC}
URL ${TPURL}/ccmio-2.06.tar.bz2
URL_MD5 809ee34a983cbc8931ca23879d92b4d0
STAMP_DIR ${TPBUILD}/stamp
DOWNLOAD_DIR ${TPSRC}
SOURCE_DIR ${TPSRC}/ccmio-2.06
BINARY_DIR ${TPBUILD}/ccmio-2.06
TMP_DIR ${TPBUILD}/ccmio-2.06-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}/ccmio-2.06
)
SET(CCMIO_LIBRARY ccmio CACHE FILEPATH
"CCMIO library" FORCE)
SET(CCMIO_INCLUDE_DIR ${TPDIST}/include CACHE FILEPATH
"CCMIO include" FORCE)
LINK_DIRECTORIES(${TPDIST}/lib)
INCLUDE_DIRECTORIES(NekMesh ${CCMIO_INCLUDE_DIR})
IF (WIN32)
MESSAGE(STATUS
"Build CCMIO: ${TPDIST}/${LIB_DIR}/${CCMIO_LIBRARY}.dll")
ELSE ()
MESSAGE(STATUS
"Build CCMIO: ${TPDIST}/${LIB_DIR}/lib${CCMIO_LIBRARY}.a")
ENDIF ()
SET(CCMIO_CONFIG_INCLUDE_DIR ${TPINC})
set(CCMIO_LIBRARIES
ccmio
adf
)
ELSE()
ADD_CUSTOM_TARGET(ccmio-2.06 ALL)
MESSAGE(STATUS "Found CCMIO: ${CCMIO_LIBRARY}")
SET(CCMIO_CONFIG_INCLUDE_DIR ${CCMIO_INCLUDE_DIR})
INCLUDE_DIRECTORIES(NekMesh ${CCMIO_INCLUDE_DIR})
LINK_DIRECTORIES(${CCMIO_LIBRARY_DIR})
ENDIF (THIRDPARTY_BUILD_CCMIO)
FIND_LIBRARY(CCMIO_LIBRARY NAMES "ccmio" PATHS /usr/local/lib ${Nektar++_TP_LIBRARY_DIRS})
IF( CCMIO_LIBRARY )
MESSAGE(STATUS "Found Ccmio: ${CCMIO_LIBRARY}")
MARK_AS_ADVANCED(CCMIO_LIBRARY)
ADD_DEFINITIONS(-DNEKTAR_USE_CCM)
FIND_PATH (CCMIO_INCLUDE_DIR ccmio.h)
GET_FILENAME_COMPONENT(CCMIO_LIBRARY_DIR ${CCMIO_LIBRARY} PATH)
INCLUDE_DIRECTORIES(NekMesh ${CCMIO_INCLUDE_DIR})
LINK_DIRECTORIES(${CCMIO_LIBRARY_DIR})
MESSAGE(STATUS ${CCMIO_LIBRARY_DIR})
ELSE()
MESSAGE(FATAL_ERROR "Cound not find ccmio library")
ENDIF()
ENDIF( NEKTAR_USE_CCM )
SET(CCMIO_LIBRARIES ccmio adf)
MARK_AS_ADVANCED(CCMIO_INCLUDE_DIR)
MARK_AS_ADVANCED(CCMIO_LIBRARY)
......@@ -233,7 +233,7 @@ void ProcessSpherigon::FindNormalFromPlyFile(MeshSharedPtr &plymesh,
typedef bg::model::point<NekDouble, 3, bg::cs::cartesian> Point;
typedef pair<Point, unsigned int> PointI;
int n_neighbs = 5;
int n_neighbs = 1;
map<int,int> TreeidtoPlyid;
......@@ -263,17 +263,10 @@ void ProcessSpherigon::FindNormalFromPlyFile(MeshSharedPtr &plymesh,
"Nearest ply verts",prog);
}
//I dont know why 5 nearest points are searched for when
//only the nearest point is used for the data
//was left like this in the ann->boost rewrite (MT 6/11/16)
Point queryPt(vIt->second->m_x, vIt->second->m_y, vIt->second->m_z);
n_neighbs = 5;
vector<PointI> result;
rtree.query(bgi::nearest(queryPt, n_neighbs), std::back_inserter(result));
ASSERTL1(bg::distance(result[0].first,queryPt) < bg::distance(result[1].first,queryPt),
"Assumption that dist values are ordered from smallest to largest is not correct");
rtree.query(bgi::nearest(queryPt, n_neighbs),
std::back_inserter(result));
cntmin = TreeidtoPlyid[result[0].second];
......
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