Commit b0d1703c authored by Dave Moxey's avatar Dave Moxey

Merge branch 'master' into fix/tet-normals

parents fa176089 9556cb2a
......@@ -5,6 +5,9 @@ RelWithDebInfo MinSizeRel.")
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)
......@@ -60,8 +63,8 @@ SET(NEKTAR_BUILD_UTILITIES ON CACHE BOOL
"Build utilities for pre-processing and post-processing Nektar++ files.")
SET(NEKTAR_BUILD_UNIT_TESTS ON CACHE BOOL
"Build unit tests.")
SET(NEKTAR_BUILD_REGRESSION_TESTS ON CACHE BOOL
"Build regression tests for checking the correctness of the code.")
SET(NEKTAR_BUILD_TESTS ON CACHE BOOL
"Build tests for checking the correctness of the code.")
SET(NEKTAR_BUILD_TIMINGS OFF CACHE BOOL
"Build benchmark timing codes.")
......@@ -86,6 +89,8 @@ SET(ExpressionTemplateDefault OFF)
SET(NEKTAR_USE_EXPRESSION_TEMPLATES ${ExpressionTemplateDefault} CACHE BOOL "")
MARK_AS_ADVANCED(NEKTAR_USE_EXPRESSION_TEMPLATES)
SET(NEKTAR_USE_OPENBLAS OFF CACHE BOOL
"Use OpenBLAS library as a substitute to native BLAS." )
SET(NEKTAR_USE_ACML OFF CACHE BOOL
"Use the AMD Core Math Library (ACML) for BLAS and Lapack support." )
SET(NEKTAR_USE_MEMORY_POOLS ON CACHE BOOL
......@@ -111,8 +116,14 @@ ENDIF(APPLE)
# Turn on NEKTAR_USE_WIN32_LAPACK if we are in Windows and the libraries exist.
IF( WIN32 )
IF( CMAKE_CL_64 )
FIND_LIBRARY( WIN32_BLAS NAMES libblas64 PATHS ${CMAKE_SOURCE_DIR}/ThirdParty ${CMAKE_SOURCE_DIR}/../ThirdParty )
FIND_LIBRARY( WIN32_LAPACK NAMES liblapack64 PATHS ${CMAKE_SOURCE_DIR}/ThirdParty ${CMAKE_SOURCE_DIR}/../ThirdParty )
ELSE()
FIND_LIBRARY( WIN32_BLAS NAMES blas_win32 PATHS ${CMAKE_SOURCE_DIR}/ThirdParty ${CMAKE_SOURCE_DIR}/../ThirdParty )
FIND_LIBRARY( WIN32_LAPACK NAMES lapack_win32 PATHS ${CMAKE_SOURCE_DIR}/ThirdParty ${CMAKE_SOURCE_DIR}/../ThirdParty )
ENDIF()
IF( WIN32_BLAS AND WIN32_LAPACK )
SET(Win32LapackDefault ON)
ELSE(WIN32_BLAS AND WIN32_LAPACK)
......@@ -165,6 +176,11 @@ IF( NEKTAR_USE_MKL )
SET(NEKTAR_USING_MKL TRUE)
ENDIF( NEKTAR_USE_MKL )
IF( NEKTAR_USE_OPENBLAS )
INCLUDE (FindOpenBlas)
SET(NEKTAR_USING_OPENBLAS TRUE)
ENDIF( NEKTAR_USE_OPENBLAS )
IF( NEKTAR_USE_ACCELERATE_FRAMEWORK )
INCLUDE (FindAccelerateFramework)
ENDIF( NEKTAR_USE_ACCELERATE_FRAMEWORK )
......@@ -252,10 +268,10 @@ IF (NEKTAR_BUILD_UTILITIES)
ADD_SUBDIRECTORY(utilities)
ENDIF (NEKTAR_BUILD_UTILITIES)
IF (NEKTAR_BUILD_REGRESSION_TESTS)
INCLUDE_DIRECTORIES(regressionTests)
ADD_SUBDIRECTORY(regressionTests)
ENDIF (NEKTAR_BUILD_REGRESSION_TESTS)
IF (NEKTAR_BUILD_TESTS)
INCLUDE_DIRECTORIES(tests)
ADD_SUBDIRECTORY(tests)
ENDIF (NEKTAR_BUILD_TESTS)
CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/cmake/Nektar++Config.cmake.in
${CMAKE_BINARY_DIR}/Nektar++Config.cmake @ONLY)
......@@ -267,6 +283,7 @@ INSTALL(FILES ${CMAKE_BINARY_DIR}/Nektar++Config.cmake
${CMAKE_SOURCE_DIR}/cmake/FindACML.cmake
${CMAKE_SOURCE_DIR}/cmake/FindArpack.cmake
${CMAKE_SOURCE_DIR}/cmake/FindNistSparseBlas.cmake
${CMAKE_SOURCE_DIR}/cmake/FindOpenBlas.cmake
${CMAKE_SOURCE_DIR}/cmake/FindNativeBlasLapack.cmake
${CMAKE_SOURCE_DIR}/cmake/FindMKL.cmake
${CMAKE_SOURCE_DIR}/cmake/FindMetis.cmake
......@@ -275,6 +292,7 @@ INSTALL(FILES ${CMAKE_BINARY_DIR}/Nektar++Config.cmake
${CMAKE_SOURCE_DIR}/cmake/NektarCommon.cmake
${CMAKE_SOURCE_DIR}/cmake/FindTinyXml.cmake
${CMAKE_SOURCE_DIR}/cmake/FindGSMPI.cmake
${CMAKE_SOURCE_DIR}/cmake/FindXXT.cmake
DESTINATION ${CMAKE_INSTALL_PREFIX})
INSTALL(EXPORT Nektar++Libraries DESTINATION ${LIB_DIR})
......
......@@ -5,9 +5,10 @@ SET(FFTW_SEARCH_PATHS
${CMAKE_SOURCE_DIR}/../ThirdParty/fftw-3.2.2/
${CMAKE_SOURCE_DIR}/../ThirdParty/fftw-3.2.2/lib/
${CMAKE_SOURCE_DIR}/ThirdParty/build/dist/lib
${CMAKE_SOURCE_DIR}/../ThirdParty/build/dist/lib )
${CMAKE_SOURCE_DIR}/../ThirdParty/build/dist/lib
$ENV{LD_LIBRARY_PATH} $ENV{FFTW_HOME}/lib )
FIND_LIBRARY(FFTW_LIB NAMES fftw3 PATHS ${FFTW_SEARCH_PATHS} ENV LD_LIBRARY_PATH)
FIND_LIBRARY(FFTW_LIB NAMES fftw3 fftw3f PATHS ${FFTW_SEARCH_PATHS})
SET(FFTW_FOUND FALSE)
IF (FFTW_LIB)
......
SET(GSMPI_SEARCH_PATHS
${CMAKE_SOURCE_DIR}/ThirdParty/gsmpi-1.0/
${CMAKE_SOURCE_DIR}/ThirdParty/gsmpi-1.0/build/
${CMAKE_SOURCE_DIR}/../ThirdParty/gsmpi-1.0/
${CMAKE_SOURCE_DIR}/../ThirdParty/gsmpi-1.0/build
${CMAKE_SOURCE_DIR}/ThirdParty/gsmpi-1.1/
${CMAKE_SOURCE_DIR}/ThirdParty/gsmpi-1.1/build/
${CMAKE_SOURCE_DIR}/../ThirdParty/gsmpi-1.1/
${CMAKE_SOURCE_DIR}/../ThirdParty/gsmpi-1.1/build
${CMAKE_SOURCE_DIR}/ThirdParty/dist/lib
${CMAKE_SOURCE_DIR}/../ThirdParty/dist/lib)
FIND_LIBRARY(GSMPI_LIBRARY NAMES gsmpi PATHS ${GSMPI_SEARCH_PATHS})
SET(GSMPI_FOUND FALSE)
IF (GSMPI_LIBRARY)
SET(GSMPI_FOUND TRUE)
......
SET(OPEN_BLAS_SEARCH_PATHS /lib/ /lib64/ /usr/lib /usr/lib64 /usr/local/lib /usr/local/lib64 /opt/OpenBLAS/lib $ENV{OPENBLAS_HOME}/lib )
FIND_LIBRARY(OPENBLAS NAMES openblas PATHS ${OPEN_BLAS_SEARCH_PATHS})
IF (OPENBLAS)
SET(OPENBLAS_FOUND ON)
ENDIF (OPENBLAS)
IF (OPENBLAS_FOUND)
# IF (NOT NATIVE_BLAS_LAPACK_FIND_QUIETLY)
MESSAGE(STATUS "Found OpenBLAS")
# ENDIF (NOT NATIVE_BLAS_LAPACK_FIND_QUIETLY)
ELSE(OPENBLAS_FOUND)
# IF (NATIVE_BLAS_LAPACK_FIND_REQUIRED)
MESSAGE(FATAL_ERROR "Could not find OpenBLAS libraries.")
# ENDIF (NATIVE_BLAS_LAPACK_FIND_REQUIRED)
ENDIF (OPENBLAS_FOUND)
MARK_AS_ADVANCED(OPENBLAS)
IF( WIN32 AND CMAKE_CL_64 )
FIND_LIBRARY( WIN32_BLAS NAMES libblas64 PATHS
${WIN32_LAPACK_ADDITIONAL_DIRS}
${CMAKE_SOURCE_DIR}/ThirdParty
${CMAKE_SOURCE_DIR}/../ThirdParty)
FIND_LIBRARY( WIN32_LAPACK NAMES liblapack64 PATHS
${WIN32_LAPACK_ADDITIONAL_DIRS}
${CMAKE_SOURCE_DIR}/ThirdParty
${CMAKE_SOURCE_DIR}/../ThirdParty)
ELSE()
FIND_LIBRARY( WIN32_BLAS NAMES blas_win32 PATHS
${WIN32_LAPACK_ADDITIONAL_DIRS}
${CMAKE_SOURCE_DIR}/ThirdParty
......@@ -8,7 +18,7 @@ FIND_LIBRARY( WIN32_LAPACK NAMES lapack_win32 PATHS
${WIN32_LAPACK_ADDITIONAL_DIRS}
${CMAKE_SOURCE_DIR}/ThirdParty
${CMAKE_SOURCE_DIR}/../ThirdParty)
ENDIF()
CHANGE_EXTENSION(WIN32_LAPACK_DLL ${WIN32_LAPACK} "dll")
CHANGE_EXTENSION(WIN32_BLAS_DLL ${WIN32_BLAS} "dll")
......
SET(XXT_SEARCH_PATHS
${CMAKE_SOURCE_DIR}/ThirdParty/gsmpi-1.1/
${CMAKE_SOURCE_DIR}/ThirdParty/gsmpi-1.1/build/
${CMAKE_SOURCE_DIR}/../ThirdParty/gsmpi-1.1/
${CMAKE_SOURCE_DIR}/../ThirdParty/gsmpi-1.1/build
${CMAKE_SOURCE_DIR}/ThirdParty/dist/lib
${CMAKE_SOURCE_DIR}/../ThirdParty/dist/lib)
FIND_LIBRARY(XXT_LIBRARY NAMES xxt PATHS ${XXT_SEARCH_PATHS})
SET(XXT_FOUND FALSE)
IF (XXT_LIBRARY)
SET(XXT_FOUND TRUE)
MARK_AS_ADVANCED(XXT_LIBRARY)
ENDIF (XXT_LIBRARY)
IF (XXT_FOUND)
IF (NOT XXT_FIND_QUIETLY)
MESSAGE(STATUS "Found XXT")
ENDIF (NOT XXT_FIND_QUIETLY)
ELSE(XXT_FOUND)
IF (XXT_FIND_REQUIRED)
MESSAGE(FATAL_ERROR "Could not find XXT")
ENDIF (XXT_FIND_REQUIRED)
ENDIF (XXT_FOUND)
......@@ -166,3 +166,4 @@ SET(NEKTAR_USING_BLAS "@NEKTAR_USING_BLAS@")
SET(NEKTAR_USING_LAPACK "@NEKTAR_USING_LAPACK@")
SET(NEKTAR_USING_MKL "@NEKTAR_USING_MKL@")
SET(NEKTAR_USING_ACML "@NEKTAR_USING_ACML@")
SET(NEKTAR_USING_OPENBLAS "@NEKTAR_USING_OPENBLAS@")
This diff is collapsed.
......@@ -7,7 +7,8 @@ IF (THIRDPARTY_BUILD_BOOST)
IF (NOT WIN32)
# Only build the libraries we need
SET(BOOST_LIB_LIST --with-system --with-iostreams --with-filesystem
--with-program_options --with-date_time --with-thread)
--with-program_options --with-date_time --with-thread
--with-regex)
# We need -fPIC for 64-bit builds
IF( CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" )
......@@ -56,6 +57,9 @@ IF (THIRDPARTY_BUILD_BOOST)
SET(Boost_PROGRAM_OPTIONS_LIBRARY boost_program_options)
SET(Boost_PROGRAM_OPTIONS_LIBRARY_DEBUG boost_program_options)
SET(Boost_PROGRAM_OPTIONS_LIBRARY_RELEASE boost_program_options)
SET(Boost_REGEX_LIBRARY boost_regex)
SET(Boost_REGEX_LIBRARY_DEBUG boost_regex)
SET(Boost_REGEX_LIBRARY_RELEASE boost_regex)
SET(Boost_SYSTEM_LIBRARY boost_system)
SET(Boost_SYSTEM_LIBRARY_DEBUG boost_system)
SET(Boost_SYSTEM_LIBRARY_RELEASE boost_system)
......@@ -88,13 +92,13 @@ ELSE (THIRDPARTY_BUILD_BOOST)
IF( NOT BOOST_ROOT )
#If the user has not set BOOST_ROOT, look in a couple common places first.
SET(BOOST_ROOT ${CMAKE_SOURCE_DIR}/ThirdParty/boost)
FIND_PACKAGE( Boost COMPONENTS thread iostreams zlib date_time filesystem system program_options)
FIND_PACKAGE( Boost COMPONENTS thread iostreams zlib 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)
FIND_PACKAGE( Boost COMPONENTS thread iostreams zlib 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)
FIND_PACKAGE( Boost COMPONENTS thread iostreams zlib date_time filesystem system program_options regex)
ELSE()
FIND_PACKAGE( Boost COMPONENTS thread iostreams zlib date_time filesystem system program_options)
FIND_PACKAGE( Boost COMPONENTS thread iostreams zlib date_time filesystem system program_options regex)
ENDIF()
ENDIF (THIRDPARTY_BUILD_BOOST)
INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS})
......@@ -22,5 +22,4 @@ IF( NEKTAR_USE_FFTW )
INCLUDE (FindFFTW)
INCLUDE_DIRECTORIES(${FFTW_INCLUDE_DIR})
ENDIF()
ADD_DEFINITIONS(-DNEKTAR_USING_FFTW)
ENDIF( NEKTAR_USE_FFTW )
......@@ -13,20 +13,24 @@ IF( NEKTAR_USE_MPI )
IF (THIRDPARTY_BUILD_GSMPI)
EXTERNALPROJECT_ADD(
gsmpi-1.0
gsmpi-1.1
PREFIX ${TPSRC}
URL ${TPURL}/gsmpi-1.0.tar.bz2
URL_MD5 "a8ea5c3f9fac4695690ed344b380336f"
URL ${TPURL}/gsmpi-1.1.tar.bz2
URL_MD5 "f2c1f7695f361c6d87365e2ea63aece1"
DOWNLOAD_DIR ${TPSRC}
CONFIGURE_COMMAND
${CMAKE_COMMAND}
${CMAKE_COMMAND}
-DCMAKE_BUILD_TYPE:STRING=Debug
-DCMAKE_INSTALL_PREFIX:PATH=${TPSRC}/dist
${TPSRC}/src/gsmpi-1.0
${TPSRC}/src/gsmpi-1.1
)
SET(GSMPI_LIBRARY gsmpi CACHE FILEPATH
"GSMPI path" FORCE)
SET(XXT_LIBRARY xxt CACHE FILEPATH
"XXT path" FORCE)
ELSE (THIRDPARTY_BUILD_GSMPI)
INCLUDE (FindGSMPI)
INCLUDE (FindXXT)
ENDIF (THIRDPARTY_BUILD_GSMPI)
ENDIF( NEKTAR_USE_MPI )
......
......@@ -13,6 +13,7 @@ solvers/CardiacEPSolver
solvers/FluxReconstruction
solvers/VortexWaveInteraction
solvers/ImageWarpingSolver
solvers/PulseWaveSolver
docs/*.doc
docs/arch
docs/emacs
......
......@@ -88,3 +88,50 @@ FOREACH(dir ${dir_list})
ADD_SUBDIRECTORY(${dir})
ENDIF(IS_DIRECTORY ${dir} AND EXISTS ${dir}/CMakeLists.txt)
ENDFOREACH(dir ${dir_list})
ADD_NEKTAR_TEST(LocProject1D_Ortho_Basis_P6_Q7)
ADD_NEKTAR_TEST(LocProject1D_Mod_Basis_P6_Q7)
ADD_NEKTAR_TEST(LocProject_Diff1D_Ortho_Basis_P6_Q7)
ADD_NEKTAR_TEST(LocProject_Diff1D_Mod_Basis_P6_Q7)
ADD_NEKTAR_TEST(LocProject2D_Tri_Ortho_Basis_P6_Q7)
ADD_NEKTAR_TEST(LocProject2D_Tri_Mod_Basis_P6_Q7)
ADD_NEKTAR_TEST(LocProject2D_Tri_Nodal_Basis_P6_Q7)
ADD_NEKTAR_TEST(LocProject2D_Quad_Ortho_Basis_P6_Q7)
ADD_NEKTAR_TEST(LocProject2D_Quad_Mod_Basis_P6_Q7)
ADD_NEKTAR_TEST(LocProject2D_Quad_Lagrange_Basis_P6_Q7)
ADD_NEKTAR_TEST(LocProject2D_Def_Quad_Ortho_Basis_P4_Q5)
ADD_NEKTAR_TEST(LocProject2D_Def_Quad_Mod_Basis_P6_Q7)
ADD_NEKTAR_TEST(LocProject2D_Def_Quad_Lagrange_Basis_P6_Q7)
ADD_NEKTAR_TEST(LocProject3D_Tet_Ortho_Basis_P6_Q7)
ADD_NEKTAR_TEST(LocProject3D_Tet_Mod_Basis_P6_Q7)
ADD_NEKTAR_TEST(LocProject3D_Prism_Ortho_Basis_P6_Q7)
ADD_NEKTAR_TEST(LocProject3D_Prism_Mod_Basis_P6_Q7)
ADD_NEKTAR_TEST(LocProject3D_Hex_Ortho_Basis_P6_Q7)
ADD_NEKTAR_TEST(LocProject3D_Hex_Mod_Basis_P6_Q7)
ADD_NEKTAR_TEST(LocProject3D_Hex_Lagrange_Basis_P6_Q7)
ADD_NEKTAR_TEST(LocProject3D_Def_Hex_Ortho_Basis_P6_Q7)
ADD_NEKTAR_TEST(LocProject3D_Def_Hex_Mod_Basis_P6_Q7)
ADD_NEKTAR_TEST(LocProject3D_Def_Hex_Lagrange_Basis_P6_Q7)
ADD_NEKTAR_TEST(LocProject_Diff3D_Lin_Deformed_Hex_Lagrange_Basis_P6_Q7)
ADD_NEKTAR_TEST(LocProject_Diff3D_Lin_Deformed_Hex_Mod_Basis_P6_Q7)
ADD_NEKTAR_TEST(LocProject_Diff3D_Lin_Deformed_Hex_Ortho_Basis_P6_Q7)
ADD_NEKTAR_TEST(LocProject_Diff3D_Reg_Hex_Lagrange_Basis_P6_Q7)
ADD_NEKTAR_TEST(LocProject_Diff3D_Reg_Hex_Mod_Basis_P6_Q7)
ADD_NEKTAR_TEST(LocProject_Diff3D_Reg_Hex_Ortho_Basis_P6_Q7)
ADD_NEKTAR_TEST(LocProject_Diff3D_Reg_Prism_Mod_Basis_P6_Q7)
ADD_NEKTAR_TEST(LocProject_Diff3D_Reg_Prism_Ortho_Basis_P6_Q7)
ADD_NEKTAR_TEST(LocProject_Diff3D_Reg_Tet_Mod_Basis_P6_Q7)
ADD_NEKTAR_TEST(LocProject_Diff3D_Reg_Tet_Ortho_Basis_P6_Q7)
ADD_NEKTAR_TEST(LocProject_Diff2D_Lin_Deformed_Quad_Lagrange_Basis_P6_Q7)
ADD_NEKTAR_TEST(LocProject_Diff2D_Lin_Deformed_Quad_Mod_Basis_P6_Q7)
ADD_NEKTAR_TEST(LocProject_Diff2D_Lin_Deformed_Quad_Ortho_Basis_P4_Q5)
ADD_NEKTAR_TEST(LocProject_Diff2D_Reg_Quad_Lagrange_Basis_P6_Q=7)
ADD_NEKTAR_TEST(LocProject_Diff2D_Reg_Quad_Mod_Basis_P6_Q7)
ADD_NEKTAR_TEST(LocProject_Diff2D_Reg_Quad_Ortho_Basis_P4_Q=5)
ADD_NEKTAR_TEST(LocProject_Diff2D_Tri_Mod_Basis_P6_Q7)
ADD_NEKTAR_TEST(LocProject_Diff2D_Tri_Nodal_Basis_P6_Q7)
ADD_NEKTAR_TEST(LocProject_Diff2D_Tri_Ortho_Basis_P6_Q7)
......@@ -258,8 +258,8 @@ int main(int argc, char *argv[])
//-------------------------------------------
// Evaulate solution at x = y = z = 0 and print error
Array<OneD, NekDouble> t = Array<OneD, NekDouble>(3);
t[0] = -0.39;
t[1] = -0.25;
t[0] = 0.5;
t[1] = 0.5;
t[2] = 0.5;
NekDouble numericSolution = lhe->PhysEvaluate(t);
......
......@@ -247,11 +247,11 @@ int main(int argc, char *argv[])
//--------------------------------------------
//-------------------------------------------
// Evaulate solution at x = y = z = 0 and print error
// Evaulate solution at mid point and print error
Array<OneD, NekDouble> t = Array<OneD, NekDouble>(3);
t[0] = -0.39;
t[1] = -0.25;
t[2] = -0.50;
t[0] = 0.5;
t[1] = 0.5;
t[2] = 0.2;
if( regionShape == StdRegions::ePrism ) {
solution[0] = Prism_sol( t[0], t[1], t[2], P, Q, R, bType_x, bType_y, bType_z );
......
......@@ -19,9 +19,8 @@ NekDouble Quad_sol(NekDouble x, NekDouble y, int order1, int order2,
int main(int argc, char *argv[])
{
int i;
int order1,order2, nq1,nq2,NodalTri = 0;
LibUtilities::PointsType Qtype1,Qtype2;
LibUtilities::BasisType btype1,btype2;
......@@ -31,23 +30,23 @@ int main(int argc, char *argv[])
Array<OneD, NekDouble> sol;
Array<OneD, NekDouble> coords(8);
StdRegions::Orientation edgeDir = StdRegions::eForwards;
if((argc != 16)&&(argc != 14))
{
// arg[0] arg[1] arg[2] arg[3] arg[4] arg[5] arg[6] arg[7] arg[8] arg[9] arg[10] arg[11] arg[12] arg[13]
fprintf(stderr,"Usage: Project2D RegionShape Type1 Type2 order1 order2 nq1 nq2 x1, y1, x2, y2, x3, y3 \n");
fprintf(stderr,"Example : ./LocProject2D-g 2 4 5 3 3 4 4 .1 -.5 .6 .1 .3 .2 \n" );
fprintf(stderr,"Where RegionShape is an integer value which "
"dictates the region shape:\n");
fprintf(stderr,"\t Triangle = 2\n");
fprintf(stderr,"\t Quadrilateral = 3\n");
fprintf(stderr,"Where type is an integer value which "
"dictates the basis as:\n");
fprintf(stderr,"\t Ortho_A = 1\n");
fprintf(stderr,"\t Ortho_B = 2\n");
fprintf(stderr,"\t Modified_A = 4\n");
......@@ -58,24 +57,24 @@ int main(int argc, char *argv[])
fprintf(stderr,"\t Chebyshev = 10\n");
fprintf(stderr,"\t Nodal tri (Electro) = 11\n");
fprintf(stderr,"\t Nodal tri (Fekete) = 12\n");
fprintf(stderr,"Note type = 3,6 are for three-dimensional basis\n");
fprintf(stderr,"The last series of values are the coordinates\n");
exit(1);
}
regionshape = (StdRegions::ExpansionType) atoi(argv[1]);
// Check to see if 2D region
if((regionshape != StdRegions::eTriangle)&&(regionshape != StdRegions::eQuadrilateral))
{
NEKERROR(ErrorUtil::efatal,"This shape is not a 2D region");
}
int btype1_val = atoi(argv[2]);
int btype2_val = atoi(argv[3]);
if(( btype1_val <= 10)&&( btype2_val <= 10))
{
btype1 = (LibUtilities::BasisType) btype1_val;
......@@ -85,7 +84,7 @@ int main(int argc, char *argv[])
{
btype1 = LibUtilities::eOrtho_A;
btype2 = LibUtilities::eOrtho_B;
if(btype1_val == 11)
{
NodalType = LibUtilities::eNodalTriElec;
......@@ -94,49 +93,47 @@ int main(int argc, char *argv[])
{
NodalType = LibUtilities::eNodalTriFekete;
}
}
// Check to see that correct Expansions are used
switch(regionshape)
{
case StdRegions::eTriangle:
if((btype1 == LibUtilities::eOrtho_B)||(btype1 == LibUtilities::eModified_B))
{
NEKERROR(ErrorUtil::efatal,
"Basis 1 cannot be of type Ortho_B or Modified_B");
}
break;
case StdRegions::eQuadrilateral:
if((btype1 == LibUtilities::eOrtho_B)||(btype1 == LibUtilities::eOrtho_C)||
(btype1 == LibUtilities::eModified_B)||(btype1 == LibUtilities::eModified_C))
{
NEKERROR(ErrorUtil::efatal,
"Basis 1 is for 2 or 3D expansions");
}
if((btype2 == LibUtilities::eOrtho_B)||(btype2 == LibUtilities::eOrtho_C)||
(btype2 == LibUtilities::eModified_B)||(btype2 == LibUtilities::eModified_C))
{
NEKERROR(ErrorUtil::efatal,
"Basis 2 is for 2 or 3D expansions");
}
break;
default:
ASSERTL0(false, "Not a 2D expansion.");
break;
case StdRegions::eTriangle:
if((btype1 == LibUtilities::eOrtho_B)||(btype1 == LibUtilities::eModified_B))
{
NEKERROR(ErrorUtil::efatal,
"Basis 1 cannot be of type Ortho_B or Modified_B");
}
break;
case StdRegions::eQuadrilateral:
if((btype1 == LibUtilities::eOrtho_B)||(btype1 == LibUtilities::eOrtho_C)||
(btype1 == LibUtilities::eModified_B)||(btype1 == LibUtilities::eModified_C))
{
NEKERROR(ErrorUtil::efatal,
"Basis 1 is for 2 or 3D expansions");
}
if((btype2 == LibUtilities::eOrtho_B)||(btype2 == LibUtilities::eOrtho_C)||
(btype2 == LibUtilities::eModified_B)||(btype2 == LibUtilities::eModified_C))
{
NEKERROR(ErrorUtil::efatal,
"Basis 2 is for 2 or 3D expansions");
}
break;
default:
NEKERROR(ErrorUtil::efatal, "Not a valid 2D expansion.");
}
order1 = atoi(argv[4]);
order2 = atoi(argv[5]);
nq1 = atoi(argv[6]);
nq2 = atoi(argv[7]);
sol = Array<OneD, NekDouble>(nq1*nq2);
if(btype1 != LibUtilities::eFourier)
{
Qtype1 = LibUtilities::eGaussLobattoLegendre;
......@@ -145,7 +142,7 @@ int main(int argc, char *argv[])
{
Qtype1 = LibUtilities::eFourierEvenlySpaced;
}
if(btype2 != LibUtilities::eFourier)
{
if (regionshape == StdRegions::eTriangle) {
......@@ -154,28 +151,28 @@ int main(int argc, char *argv[])
else
{
Qtype2 = LibUtilities::eGaussLobattoLegendre;
}
}
}
else
{
Qtype2 = LibUtilities::eFourierEvenlySpaced;
}
//-----------------------------------------------
// Define a 2D expansion based on basis definition
switch(regionshape)
{
case StdRegions::eTriangle:
case StdRegions::eTriangle:
{
coords[0] = atof(argv[8]);
coords[1] = atof(argv[9]);
coords[2] = atof(argv[10]);
coords[3] = atof(argv[11]);
coords[4] = atof(argv[12]);
coords[5] = atof(argv[13]);
// Set up coordinates
SpatialDomains::VertexComponentSharedPtr verts[3];
const int zero = 0;
......@@ -185,21 +182,21 @@ int main(int argc, char *argv[])
verts[0] = MemoryManager<SpatialDomains::VertexComponent>::AllocateSharedPtr(two,zero,coords[0],coords[1],dZero);
verts[1] = MemoryManager<SpatialDomains::VertexComponent>::AllocateSharedPtr(two,one,coords[2],coords[3],dZero);
verts[2] = MemoryManager<SpatialDomains::VertexComponent>::AllocateSharedPtr(two,two,coords[4],coords[5],dZero);
// Set up Edges
SpatialDomains::SegGeomSharedPtr edges[3];
edges[0] = MemoryManager<SpatialDomains::SegGeom>::AllocateSharedPtr(zero,verts[0],verts[1]);
edges[1] = MemoryManager<SpatialDomains::SegGeom>::AllocateSharedPtr(one,verts[1],verts[2]);
edges[2] = MemoryManager<SpatialDomains::SegGeom>::AllocateSharedPtr(two,verts[2],verts[0]);
StdRegions::Orientation eorient[3];
eorient[0] = edgeDir;
eorient[1] = edgeDir;
eorient[2] = edgeDir;
SpatialDomains::TriGeomSharedPtr geom = MemoryManager<SpatialDomains::TriGeom>::AllocateSharedPtr(zero,verts,edges,eorient);