Commit 9dafe5e2 authored by Michael Turner's avatar Michael Turner
Browse files

added ls-lm optimiser library

parent 22d1a548
......@@ -184,6 +184,7 @@ INCLUDE (ThirdPartyQT4)
INCLUDE (ThirdPartySMV)
INCLUDE (ThirdPartyTriangle)
INCLUDE (ThirdPartyTetGen)
INCLUDE (ThirdPartyLmfit)
INCLUDE (ThirdPartyCCM)
INCLUDE (Doxygen)
......
########################################################################
#
# ThirdParty configuration for Nektar++
#
# LMFIT
#
########################################################################
IF(NEKTAR_USE_MESH)
SET(BUILD_LMFIT ON)
OPTION(THIRDPARTY_BUILD_LMFIT
"Build lmfit library from ThirdParty." ${BUILD_LMFIT})
IF (THIRDPARTY_BUILD_LMFIT)
INCLUDE(ExternalProject)
EXTERNALPROJECT_ADD(
lmfit-5.1
PREFIX ${TPSRC}
URL http://ae-nektar.ae.ic.ac.uk/~mt4313/lmfit.zip
URL_MD5 7a32f672fbe911ecc8302eef385b3780
STAMP_DIR ${TPBUILD}/stamp
DOWNLOAD_DIR ${TPSRC}
SOURCE_DIR ${TPSRC}/lmfit-5.1
BINARY_DIR ${TPBUILD}/lmfit-5.1
TMP_DIR ${TPBUILD}/lmfit-5.1-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}/lmfit-5.1
)
SET(LMFIT_LIBRARY lmfit CACHE FILEPATH
"lmfit library" FORCE)
SET(LMFIT_INCLUDE_DIR ${TPDIST}/include CACHE FILEPATH
"lmfit include" FORCE)
LINK_DIRECTORIES(${TPDIST}/lib)
IF (WIN32)
MESSAGE(STATUS
"Build lmfit: ${TPDIST}/${LIB_DIR}/${LMFIT_LIBRARY}.dll")
ELSE ()
MESSAGE(STATUS
"Build lmfit: ${TPDIST}/${LIB_DIR}/lib${LMFIT_LIBRARY}.a")
ENDIF ()
SET(LMFIT_CONFIG_INCLUDE_DIR ${TPINC})
ELSE()
ADD_CUSTOM_TARGET(lmfit-5.1 ALL)
MESSAGE(STATUS "Found lmfit: ${LMFIT_LIBRARY}")
SET(LMFIT_CONFIG_INCLUDE_DIR ${LMFIT_INCLUDE_DIR})
ENDIF (THIRDPARTY_BUILD_LMFIT)
INCLUDE_DIRECTORIES(SYSTEM ${LMFIT_INCLUDE_DIR})
ENDIF(NEKTAR_USE_MESH)
......@@ -27,6 +27,7 @@ ADD_NEKTAR_LIBRARY(MeshUtils lib ${NEKTAR_LIBRARY_TYPE}
TARGET_LINK_LIBRARIES(MeshUtils LINK_PUBLIC LibUtilities)
TARGET_LINK_LIBRARIES(MeshUtils LINK_PRIVATE ${TRIANGLE_LIBRARY})
TARGET_LINK_LIBRARIES(MeshUtils LINK_PRIVATE ${TETGEN_LIBRARY})
TARGET_LINK_LIBRARIES(MeshUtils LINK_PRIVATE ${LMFIT_LIBRARY})
INSTALL(DIRECTORY ./
DESTINATION ${NEKTAR_INCLUDE_DIR}/MeshUtils
......
......@@ -140,6 +140,8 @@ namespace MeshUtils {
e->SetHONodes(honodes);
//this needs a 1d optimisation step
}
else
{
......@@ -166,6 +168,21 @@ namespace MeshUtils {
}
NekDouble dz = 2.0/m_order;
for(int i = 1; i < m_order+1 -1; i++)
{
NekDouble zi = -1.0 + dz;
NekDouble zi1 = -1.0 + dz +dz;
Array<OneD, NekDouble> uvi = Nodes[honodes[i-1]]->GetS(e->GetSurf());
Array<OneD, NekDouble> uvi1 = Nodes[honodes[i]]->GetS(e->GetSurf());
Array<OneD, NekDouble> li = Nodes[honodes[i-1]]->GetLoc();
Array<OneD, NekDouble> li1 = Nodes[honodes[i]]->GetLoc();
Array<OneD, NekDouble> ri = s->D2(uvi);
Array<OneD, NekDouble> ri1 = s->D2(uvi1);
}
e->SetHONodes(honodes);
}
}
......
......@@ -261,29 +261,6 @@ namespace Utilities
}
}
m_mesh->m_element[m_mesh->m_expDim-1].clear();
vector<ElementSharedPtr> elements = m_mesh->m_element[m_mesh->m_expDim];
m_mesh->m_element[m_mesh->m_expDim].clear();
for(int i = 0; i < elements.size(); i++)
{
int nodeonsurf = 0;
vector<NodeSharedPtr> n = elements[i]->GetVertexList();
for(int j = 0; j < n.size(); j++)
{
if(Nodes[n[j]->m_mid]->IsOnSurf(9))
{
nodeonsurf++;
}
}
if(nodeonsurf == 3)
{
m_mesh->m_element[m_mesh->m_expDim].push_back(elements[i]);
}
}
}
......
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