Commit f1bdff62 authored by Dave Moxey's avatar Dave Moxey

Merge branch 'master' into feature/gzip

parents 0b53edf0 ba064069
......@@ -8,9 +8,13 @@ PROJECT(Nektar++)
# Helps organize projects in IDEs.
SET_PROPERTY(GLOBAL PROPERTY USE_FOLDERS ON)
SET(NEKTAR_VERSION_MAJOR 3)
SET(NEKTAR_VERSION_MINOR 2)
SET(NEKTAR_VERSION_PATCH 0)
# Extract the version number from the VERSION file and set in CMake
# The format of this file must be X.X.X
FILE(STRINGS "VERSION" NEKVER)
STRING(REPLACE "." ";" NEKVERLIST ${NEKVER})
LIST(GET NEKVERLIST 0 NEKTAR_VERSION_MAJOR)
LIST(GET NEKVERLIST 1 NEKTAR_VERSION_MINOR)
LIST(GET NEKVERLIST 2 NEKTAR_VERSION_PATCH)
SET(NEKTAR_VERSION ${NEKTAR_VERSION_MAJOR}.${NEKTAR_VERSION_MINOR}.${NEKTAR_VERSION_PATCH})
INCLUDE(CMakeExportBuildSettings)
......
......@@ -18,7 +18,7 @@ ENDIF (FFTW_LIB)
IF (FFTW_FOUND)
IF (NOT FFTW_LIB_FIND_QUIETLY)
MESSAGE(STATUS "Found FFTW")
MESSAGE(STATUS "Found FFTW: ${FFTW_LIB}")
GET_FILENAME_COMPONENT(FFTW_PATH ${FFTW_LIB} PATH CACHE)
SET(FFTW_INCLUDE_DIR ${FFTW_PATH}/../include CACHE FILEPATH "FFTW include directory.")
MARK_AS_ADVANCED(FFTW_PATH)
......
......@@ -167,10 +167,10 @@ MACRO(ADD_NEKTAR_EXECUTABLE name component sources)
${Boost_FILESYSTEM_LIBRARY}
${Boost_SYSTEM_LIBRARY}
${Boost_PROGRAM_OPTIONS_LIBRARY}
${Boost_ZLIB_LIBRARY}
${ZLIB_LIBRARY}
optimized ${TINYXML_LIB} debug ${TINYXML_LIB}
)
ADD_DEPENDENCIES(${name} boost tinyxml zlib)
ADD_DEPENDENCIES(${name} boost tinyxml zlib-1.2.7)
IF( NEKTAR_USE_MPI )
TARGET_LINK_LIBRARIES(${name} ${MPI_LIBRARY} ${MPI_EXTRA_LIBRARY})
......@@ -221,7 +221,8 @@ MACRO(ADD_NEKTAR_LIBRARY name component type)
# NIST Sparse BLAS only static, so link into Nektar libraries directly.
TARGET_LINK_LIBRARIES( ${name} ${NIST_SPARSE_BLAS} ${METIS_LIB})
ADD_DEPENDENCIES(${name} spblastk0.9b modmetis-5.0.2 boost tinyxml zlib)
ADD_DEPENDENCIES(${name} spblastk0.9b modmetis-5.0.2 boost tinyxml
zlib-1.2.7)
SET_PROPERTY(TARGET ${name} PROPERTY FOLDER ${component})
IF (NEKTAR_USE_MPI)
TARGET_LINK_LIBRARIES( ${name} ${GSMPI_LIBRARY} ${XXT_LIBRARY})
......
......@@ -40,10 +40,10 @@ IF (THIRDPARTY_BUILD_BOOST)
INSTALL_COMMAND ""
BUILD_IN_SOURCE 1
)
# If building ThirdParty zlib, force zlib build before boost
IF (THIRDPARTY_BUILD_ZLIB)
ADD_DEPENDENCIES(boost zlib)
ADD_DEPENDENCIES(boost zlib-1.2.7)
ENDIF(THIRDPARTY_BUILD_ZLIB)
# Set up CMake variables
......@@ -86,8 +86,7 @@ IF (THIRDPARTY_BUILD_BOOST)
)
ENDIF ()
ELSE (THIRDPARTY_BUILD_BOOST)
SET(Boost_DEBUG 1)
SET(Boost_ADDITIONAL_VERSIONS "1.51" "1.51.0" "1.50" "1.50.0" "1.49" "1.49.0" "1.48" "1.48.0" "1.47.0" "1.47" "1.46" "1.46. 1" "1.40" "1.40.0" "1.35.0" "1.35")
SET(Boost_DEBUG 0)
SET(Boost_NO_BOOST_CMAKE ON)
#If the user has not set BOOST_ROOT, look in a couple common places first.
......@@ -96,19 +95,40 @@ ELSE (THIRDPARTY_BUILD_BOOST)
IF (DEFINED TEST_ENV)
SET(Boost_NO_SYSTEM_PATHS ON)
SET(BOOST_ROOT $ENV{BOOST_HOME})
FIND_PACKAGE( Boost COMPONENTS thread iostreams zlib date_time
FIND_PACKAGE( Boost QUIET COMPONENTS thread iostreams date_time
filesystem system program_options regex )
ELSE ()
SET(BOOST_ROOT ${CMAKE_SOURCE_DIR}/ThirdParty/boost)
FIND_PACKAGE( Boost COMPONENTS thread iostreams zlib date_time filesystem system program_options regex)
FIND_PACKAGE( Boost QUIET COMPONENTS thread iostreams date_time filesystem system program_options regex)
SET(BOOST_ROOT ${CMAKE_SOURCE_DIR}/../ThirdParty/boost)
FIND_PACKAGE( Boost COMPONENTS thread iostreams zlib date_time filesystem system program_options regex)
FIND_PACKAGE( Boost QUIET COMPONENTS thread iostreams date_time filesystem system program_options regex)
SET(BOOST_ROOT ${CMAKE_SOURCE_DIR}/ThirdParty/dist)
FIND_PACKAGE( Boost COMPONENTS thread iostreams zlib date_time filesystem system program_options regex)
FIND_PACKAGE( Boost QUIET COMPONENTS thread iostreams date_time filesystem system program_options regex)
ENDIF()
ELSE()
FIND_PACKAGE( Boost COMPONENTS thread iostreams zlib date_time filesystem system program_options regex)
ENDIF()
IF (Boost_IOSTREAMS_FOUND)
MESSAGE(STATUS "Found Boost iostreams library: ${Boost_IOSTREAMS_LIBRARY}")
ENDIF ()
IF (Boost_THREAD_FOUND)
MESSAGE(STATUS "Found Boost thread library: ${Boost_THREAD_LIBRARY}")
ENDIF ()
IF (Boost_DATE_TIME_FOUND)
MESSAGE(STATUS "Found Boost date_time library: ${Boost_DATE_TIME_LIBRARY}")
ENDIF ()
IF (Boost_FILESYSTEM_FOUND)
MESSAGE(STATUS "Found Boost filesystem library: ${Boost_FILESYSTEM_LIBRARY}")
ENDIF ()
IF (Boost_SYSTEM_FOUND)
MESSAGE(STATUS "Found Boost system library: ${Boost_SYSTEM_LIBRARY}")
ENDIF ()
IF (Boost_PROGRAM_OPTIONS_FOUND)
MESSAGE(STATUS "Found Boost program_options library: ${Boost_PROGRAM_OPTIONS_LIBRARY}")
ENDIF ()
IF (Boost_REGEX_FOUND)
MESSAGE(STATUS "Found Boost regex library: ${Boost_REGEX_LIBRARY}")
ENDIF ()
ENDIF (THIRDPARTY_BUILD_BOOST)
INCLUDE_DIRECTORIES(SYSTEM ${Boost_INCLUDE_DIRS})
......@@ -21,6 +21,7 @@ IF( NEKTAR_USE_FFTW )
SET(FFTW_LIB fftw3)
MARK_AS_ADVANCED(FFTW_LIB)
INCLUDE_DIRECTORIES(${TPSRC}/dist/include)
MESSAGE(STATUS "Build FFTW: ${TPSRC}/dist/lib/lib${FFTW_LIB}.so")
ELSE ()
INCLUDE (FindFFTW)
INCLUDE_DIRECTORIES(${FFTW_INCLUDE_DIR})
......
......@@ -31,6 +31,8 @@ IF( NEKTAR_USE_MPI )
SET(XXT_LIBRARY xxt CACHE FILEPATH
"XXT path" FORCE)
MARK_AS_ADVANCED(XXT_LIBRARY)
MESSAGE(STATUS "Build GSMPI: ${TPSRC}/dist/lib/lib${GSMPI_LIBRARY}.a")
MESSAGE(STATUS "Build XXT: ${TPSRC}/dist/lib/lib${XXT_LIBRARY}.a")
ELSE (THIRDPARTY_BUILD_GSMPI)
INCLUDE (FindGSMPI)
INCLUDE (FindXXT)
......
......@@ -16,6 +16,7 @@ IF (THIRDPARTY_BUILD_METIS)
MARK_AS_ADVANCED(METIS_LIB)
LINK_DIRECTORIES(${TPSRC}/dist/lib)
INCLUDE_DIRECTORIES(${TPSRC}/dist/include)
MESSAGE(STATUS "Build Metis: ${TPSRC}/dist/lib/lib${METIS_LIB}.a")
ELSE (THIRDPARTY_BUILD_METIS)
INCLUDE (FindMetis)
ENDIF (THIRDPARTY_BUILD_METIS)
......
......@@ -6,4 +6,7 @@ IF( NEKTAR_USE_QT4 )
FIND_PACKAGE(Qt4 COMPONENTS QtCore QtGui REQUIRED)
INCLUDE(${QT_USE_FILE})
ADD_DEFINITIONS(${QT_DEFINITIONS})
IF (QT4_FOUND)
MESSAGE(STATUS "Found QT4: ${QT_INCLUDE_DIR}")
ENDIF(QT4_FOUND)
ENDIF( NEKTAR_USE_QT4 )
......@@ -15,6 +15,7 @@ IF (THIRDPARTY_BUILD_NIST_SPBLASTK)
"Path to NIST Sparse BLAS." FORCE)
MARK_AS_ADVANCED(NIST_SPARSE_BLAS)
LINK_DIRECTORIES(${TPSRC}/dist/lib)
MESSAGE(STATUS "Build NIST Sparse BLAS: ${TPSRC}/dist/lib/lib${NIST_SPARSE_BLAS}.a")
ELSE (THIRDPARTY_BUILD_NIST_SPBLASTK)
INCLUDE(FindNistSparseBlas)
ENDIF (THIRDPARTY_BUILD_NIST_SPBLASTK)
......
......@@ -25,9 +25,11 @@ IF( NEKTAR_USE_VTK )
INCLUDE (${VTK_DIR}/VTKConfig.cmake)
ELSE()
INCLUDE (FindVTK)
IF (NOT VTK_FOUND)
IF (VTK_FOUND)
MESSAGE(STATUS "Found VTK: ${VTK_USE_FILE}")
ELSE (VTK_FOUND)
MESSAGE(FATAL_ERROR "VTK not found")
ENDIF (NOT VTK_FOUND)
ENDIF (VTK_FOUND)
ENDIF()
INCLUDE (${VTK_USE_FILE})
......
OPTION(THIRDPARTY_BUILD_ZLIB "Build ZLib library" OFF)
########################################################################
#
# ThirdParty configuration for Nektar++
#
# ZLib
#
########################################################################
# Attempt to identify Macports libraries, if they exist. This prevents
# cmake warnings later on.
SET(ZLIB_ROOT /opt/local/)
# Find a system ZLIB library
# If not found enable the THIRDPARTY_BUILD_ZLIB option
FIND_PACKAGE( ZLIB )
IF (ZLIB_FOUND AND NOT ZLIB_VERSION_PATCH LESS 7 )
SET(ZLIB_LIBRARY ${ZLIB_LIBRARIES})
SET(ZLIB_LIBRARY_DEBUG ${ZLIB_LIBRARIES})
SET(ZLIB_LIBRARY_RELEASE ${ZLIB_LIBRARIES})
MESSAGE(STATUS "Found Zlib library: ${ZLIB_LIBRARY}")
OPTION(THIRDPARTY_BUILD_ZLIB "Build ZLib library" OFF)
ELSE ()
OPTION(THIRDPARTY_BUILD_ZLIB "Build ZLib library" ON)
ENDIF()
# If we or the user
IF (THIRDPARTY_BUILD_ZLIB)
MESSAGE(STATUS "Will build Zlib 1.2.7")
# Build the Zlib library separately
EXTERNALPROJECT_ADD(
zlib
zlib-1.2.7
PREFIX ${TPSRC}
URL ${TPURL}/zlib-1.2.3.tar.bz2
URL_MD5 "dee233bf288ee795ac96a98cc2e369b6"
URL ${TPURL}/zlib-1.2.7.tar.gz
URL_MD5 "4a162e0f643232e7e278d59a0603ceb0"
DOWNLOAD_DIR ${TPSRC}
CONFIGURE_COMMAND ./configure --shared --prefix=${TPSRC}/dist
BUILD_IN_SOURCE 1
CONFIGURE_COMMAND ${CMAKE_COMMAND} -DCMAKE_INSTALL_PREFIX:PATH=${TPSRC}/dist -DCMAKE_C_FLAGS:STRING=-fPIC ${TPSRC}/src/zlib-1.2.7
)
SET(Boost_ZLIB_LIBRARY z)
SET(Boost_ZLIB_LIBRARY_DEBUG z)
SET(Boost_ZLIB_LIBRARY_RELEASE z)
ELSE (THIRDPARTY_BUILD_ZLIB)
# Attempt to identify Macports libraries, if they exist. This prevents
# cmake warnings later on.
IF (APPLE)
FIND_LIBRARY(ZLIB_LIBRARY z PATHS /opt/local/lib NO_DEFAULT_PATH)
ENDIF()
# Find a system ZLIB library and use that instead
IF (ZLIB_LIBRARY-NOTFOUND OR NOT APPLE)
FIND_PACKAGE( ZLIB )
IF (ZLIB_FOUND)
SET(ZLIB_LIBRARY ${ZLIB_LIBRARIES})
ENDIF()
ENDIF()
IF (ZLIB_LIBRARY)
SET(Boost_ZLIB_LIBRARY ${ZLIB_LIBRARY})
SET(Boost_ZLIB_LIBRARY_RELEASE ${ZLIB_LIBRARY})
SET(Boost_ZLIB_LIBRARY_DEBUG ${ZLIB_LIBRARY})
ENDIF()
IF (WIN32)
SET(ZLIB_LIBRARY zlib)
SET(ZLIB_LIBRARY_DEBUG zlib)
SET(ZLIB_LIBRARY_RELEASE zlib)
ELSE (WIN32)
SET(ZLIB_LIBRARY z)
SET(ZLIB_LIBRARY_DEBUG z)
SET(ZLIB_LIBRARY_RELEASE z)
ENDIF (WIN32)
ENDIF (THIRDPARTY_BUILD_ZLIB)
......@@ -5,7 +5,7 @@ SET(LinkLibraries
optimized LibUtilities debug LibUtilities-g
optimized ${Boost_THREAD_LIBRARY_RELEASE} debug ${Boost_THREAD_LIBRARY_DEBUG}
optimized ${Boost_IOSTREAMS_LIBRARY_RELEASE} debug ${Boost_IOSTREAMS_LIBRARY_DEBUG}
optimized ${Boost_ZLIB_LIBRARY_RELEASE} debug ${Boost_ZLIB_LIBRARY_DEBUG}
optimized ${ZLIB_LIBRARY_RELEASE} debug ${ZLIB_LIBRARY_DEBUG}
optimized ${TINYXML_LIB} debug ${TINYXML_LIB}
)
......
......@@ -6,7 +6,7 @@ SET(LinkLibraries
optimized LibUtilities debug LibUtilities-g
optimized ${Boost_THREAD_LIBRARY_RELEASE} debug ${Boost_THREAD_LIBRARY_DEBUG}
optimized ${Boost_IOSTREAMS_LIBRARY_RELEASE} debug ${Boost_IOSTREAMS_LIBRARY_DEBUG}
optimized ${Boost_ZLIB_LIBRARY_RELEASE} debug ${Boost_ZLIB_LIBRARY_DEBUG}
optimized ${ZLIB_LIBRARY_RELEASE} debug ${ZLIB_LIBRARY_DEBUG}
optimized ${TINYXML_LIB} debug ${TINYXML_LIB}
optimized sbtk debug sbtk
)
......
......@@ -6,7 +6,7 @@ SET(LinkLibraries
optimized LibUtilities debug LibUtilities-g
optimized ${Boost_THREAD_LIBRARY_RELEASE} debug ${Boost_THREAD_LIBRARY_DEBUG}
optimized ${Boost_IOSTREAMS_LIBRARY_RELEASE} debug ${Boost_IOSTREAMS_LIBRARY_DEBUG}
optimized ${Boost_ZLIB_LIBRARY_RELEASE} debug ${Boost_ZLIB_LIBRARY_DEBUG}
optimized ${ZLIB_LIBRARY_RELEASE} debug ${ZLIB_LIBRARY_DEBUG}
optimized ${TINYXML_LIB} debug ${TINYXML_LIB}
optimized sbtk debug sbtk
)
......
......@@ -62,7 +62,7 @@ namespace Nektar
namespace LibUtilities
{
MeshPartition::MeshPartition(const LibUtilities::SessionReaderSharedPtr& pSession) :
m_comm(pSession->GetComm()->GetRowComm())
m_comm(pSession->GetComm())
{
ReadMesh(pSession);
}
......@@ -74,9 +74,9 @@ namespace Nektar
void MeshPartition::PartitionMesh()
{
ASSERTL0(m_comm->GetSize() > 1,
ASSERTL0(m_comm->GetRowComm()->GetSize() > 1,
"Partitioning only necessary in parallel case.");
ASSERTL0(m_meshElements.size() >= m_comm->GetSize(),
ASSERTL0(m_meshElements.size() >= m_comm->GetRowComm()->GetSize(),
"Too few elements for this many processes.");
CreateGraph(m_mesh);
......@@ -96,7 +96,7 @@ namespace Nektar
vNew.LinkEndChild(vElmtNektar);
std::string vFilename = pSession->GetSessionName() + "_P" + boost::lexical_cast<std::string>(m_comm->GetRank()) + ".xml";
std::string vFilename = pSession->GetSessionName() + "_P" + boost::lexical_cast<std::string>(m_comm->GetRowComm()->GetRank()) + ".xml";
vNew.SaveFile(vFilename.c_str());
}
......@@ -325,7 +325,7 @@ namespace Nektar
BoostVertexIterator vertit, vertit_end;
Array<OneD, int> part(nGraphVerts,0);
if (m_comm->GetRank() == 0)
if (m_comm->GetRowComm()->GetRank() == 0)
{
int acnt = 0;
int vcnt = 0;
......@@ -349,21 +349,36 @@ namespace Nektar
}
// Call Metis and partition graph
int npart = m_comm->GetSize();
int npart = m_comm->GetRowComm()->GetSize();
int vol = 0;
try
{
// Attempt partitioning using METIS.
Metis::PartGraphVKway(nGraphVerts, xadj, adjncy, vwgt, vsize, npart, vol, part);
// Check METIS produced a valid partition and fix if not.
CheckPartitions(part);
// Distribute partitioning to all processes.
for (i = 1; i < m_comm->GetSize(); ++i)
//////////////////////////////////////////////////////
// On a cartesian communicator do mesh partiotion just on the first column
// so there is no doubt the partitions are all the same in all the columns
if(m_comm->GetColumnComm()->GetRank() == 0)
{
// Attempt partitioning using METIS.
Metis::PartGraphVKway(nGraphVerts, xadj, adjncy, vwgt, vsize, npart, vol, part);
// Check METIS produced a valid partition and fix if not.
CheckPartitions(part);
// distribute among columns
for (i = 1; i < m_comm->GetColumnComm()->GetSize(); ++i)
{
m_comm->GetColumnComm()->Send(i, part);
}
}
else
{
m_comm->GetColumnComm()->Recv(0, part);
}
m_comm->GetColumnComm()->Block();
//////////////////////////////////
// distribute among rows
for (i = 1; i < m_comm->GetRowComm()->GetSize(); ++i)
{
m_comm->Send(i, part);
m_comm->GetRowComm()->Send(i, part);
}
}
catch (...)
......@@ -374,7 +389,7 @@ namespace Nektar
}
else
{
m_comm->Recv(0, part);
m_comm->GetRowComm()->Recv(0, part);
}
// Create boost subgraph for this process's partitions
......@@ -386,7 +401,7 @@ namespace Nektar
vertit != vertit_end;
++vertit, ++i)
{
if (part[i] == m_comm->GetRank())
if (part[i] == m_comm->GetRowComm()->GetRank())
{
pGraph[*vertit].partition = part[i];
pGraph[*vertit].partid = boost::num_vertices(pLocalPartition);
......@@ -400,7 +415,7 @@ namespace Nektar
{
unsigned int i = 0;
unsigned int cnt = 0;
const unsigned int npart = m_comm->GetSize();
const unsigned int npart = m_comm->GetRowComm()->GetSize();
bool valid = true;
// Check that every process has at least one element assigned
......
......@@ -814,10 +814,13 @@ namespace Nektar
FunctionVariableMap::const_iterator it2;
std::string vName = boost::to_upper_copy(pName);
if ((it1 = m_functions.find(vName)) != m_functions.end() &&
(it2 = it1->second.find(pVariable)) != it1->second.end())
// Check function exists
if ((it1 = m_functions.find(vName)) != m_functions.end())
{
return true;
bool varExists =
(it2 = it1->second.find(pVariable)) != it1->second.end() ||
(it2 = it1->second.find("*")) != it1->second.end();
return varExists;
}
return false;
}
......@@ -831,18 +834,33 @@ namespace Nektar
const std::string &pVariable) const
{
FunctionMap::const_iterator it1;
FunctionVariableMap::const_iterator it2;
FunctionVariableMap::const_iterator it2, it3;
std::string vName = boost::to_upper_copy(pName);
ASSERTL0((it1 = m_functions.find(vName)) != m_functions.end(),
std::string("No such function '") + pName
+ std::string("' has been defined in the session file."));
ASSERTL0((it2 = it1->second.find(pVariable)) != it1->second.end(),
// Check for specific and wildcard definitions
bool specific = (it2 = it1->second.find(pVariable)) !=
it1->second.end();
bool wildcard = (it3 = it1->second.find("*")) !=
it1->second.end();
// Check function is defined somewhere
ASSERTL0(specific || wildcard,
std::string("No such variable '") + pVariable
+ std::string("' defined for function '") + pName
+ std::string("' in session file."));
// If not specific, must be wildcard
if (!specific)
{
it2 = it3;
}
ASSERTL0((it2->second.m_type == eFunctionTypeExpression),
std::string("Function is defined by a file."));
std::string("Function is defined by a file."));
return it2->second.m_expression;
}
......@@ -867,17 +885,32 @@ namespace Nektar
const std::string &pVariable) const
{
FunctionMap::const_iterator it1;
FunctionVariableMap::const_iterator it2;
FunctionVariableMap::const_iterator it2, it3;
std::string vName = boost::to_upper_copy(pName);
it1 = m_functions.find(vName);
ASSERTL0 (it1 != m_functions.end(),
std::string("Function '") + pName
+ std::string("' not found."));
ASSERTL0 ((it2 = it1->second.find(pVariable)) != it1->second.end(),
std::string("No such variable '") + pVariable
+ std::string("' defined for function '") + pName
+ std::string("' in session file."));
// Check for specific and wildcard definitions
bool specific = (it2 = it1->second.find(pVariable)) !=
it1->second.end();
bool wildcard = (it3 = it1->second.find("*")) !=
it1->second.end();
// Check function is defined somewhere
ASSERTL0(specific || wildcard,
std::string("No such variable '") + pVariable
+ std::string("' defined for function '") + pName
+ std::string("' in session file."));
// If not specific, must be wildcard
if (!specific)
{
it2 = it3;
}
return it2->second.m_type;
}
......@@ -902,17 +935,32 @@ namespace Nektar
const std::string &pVariable) const
{
FunctionMap::const_iterator it1;
FunctionVariableMap::const_iterator it2;
FunctionVariableMap::const_iterator it2, it3;
std::string vName = boost::to_upper_copy(pName);
it1 = m_functions.find(vName);
ASSERTL0 (it1 != m_functions.end(),
std::string("Function '") + pName
+ std::string("' not found."));
ASSERTL0 ((it2 = it1->second.find(pVariable)) != it1->second.end(),
std::string("No such variable '") + pVariable
+ std::string("' defined for function '") + pName
+ std::string("' in session file."));
// Check for specific and wildcard definitions
bool specific = (it2 = it1->second.find(pVariable)) !=
it1->second.end();
bool wildcard = (it3 = it1->second.find("*")) !=
it1->second.end();
// Check function is defined somewhere
ASSERTL0(specific || wildcard,
std::string("No such variable '") + pVariable
+ std::string("' defined for function '") + pName
+ std::string("' in session file."));
// If not specific, must be wildcard
if (!specific)
{
it2 = it3;
}
return it2->second.m_filename;
}
......@@ -1202,7 +1250,7 @@ namespace Nektar
vPartitioner->PartitionMesh();
vPartitioner->WriteLocalPartition(vSession);
vCommMesh->Block();
m_comm->Block();
m_filename = GetSessionNameRank() + ".xml";
......@@ -1715,11 +1763,16 @@ namespace Nektar
FunctionVariableDefinition funcDef;
std::string conditionType = variable->Value();
// All function variables must specify VAR
ASSERTL0(variable->Attribute("VAR"),
"Attribute VAR expected for function '"
+ functionStr + "'.");
std::string variableStr = variable->Attribute("VAR");
// If no var is specified, assume wildcard
std::string variableStr;
if (!variable->Attribute("VAR"))
{
variableStr = "*";
}
else
{
variableStr = variable->Attribute("VAR");
}
// Parse list of variables
std::vector<std::string> variableList;
......
......@@ -139,9 +139,16 @@ namespace Nektar
if(out_d2.num_elements())
{
Vmath::Vmul (nqtot,gmat[4],1,diff0,1, out_d2, 1);
Vmath::Vvtvp (nqtot,gmat[5],1,diff1,1, out_d2, 1,
out_d2,1);
if (m_geom->GetCoordim() == 3)
{
Vmath::Vmul (nqtot,gmat[4],1,diff0,1, out_d2, 1);
Vmath::Vvtvp (nqtot,gmat[5],1,diff1,1, out_d2, 1,
out_d2,1);
}
else
{
Vmath::Zero (nqtot, out_d2, 1);
}
}
}
else // regular geometry
......@@ -160,8 +167,15 @@ namespace Nektar
if(out_d2.num_elements())
{
Vmath::Smul (nqtot, gmat[4][0], diff0,1, out_d2, 1);
Blas::Daxpy (nqtot, gmat[5][0], diff1,1, out_d2, 1);
if (m_geom->GetCoordim() == 3)
{
Vmath::Smul (nqtot, gmat[4][0], diff0,1, out_d2, 1);
Blas::Daxpy (nqtot, gmat[5][0], diff1,1, out_d2, 1);
}
else
{