diff --git a/Apps/LinearElasticity/Test/Cylinder-Axisymm.reg b/Apps/LinearElasticity/Test/Cylinder-Axisymm.reg new file mode 100644 index 00000000..8426a357 --- /dev/null +++ b/Apps/LinearElasticity/Test/Cylinder-Axisymm.reg @@ -0,0 +1,11 @@ +Cylinder-Axisymm.inp -2Daxisymm -nviz 5 + +Number of elements 8 +Number of nodes 35 +Number of dofs 70 +Number of unknowns 56 +L2-norm : 5.20881e-06 +Max X-displacement : 9.21008e-06 node 22 +Max Y-displacement : 7.37456e-20 node 22 +Energy norm |u^h| = a(u^h,u^h)^0.5 : 17.0101 +External energy ((f,u^h)+(t,u^h)^0.5 : 17.0101 diff --git a/Apps/LinearElasticity/Test/Cylinder-Lagrange.reg b/Apps/LinearElasticity/Test/Cylinder-Lagrange.reg new file mode 100644 index 00000000..d3945612 --- /dev/null +++ b/Apps/LinearElasticity/Test/Cylinder-Lagrange.reg @@ -0,0 +1,13 @@ +Cylinder-Lagrange.inp -checkRHS -lagrange + +Number of elements 64 +Number of nodes 5049 +Number of dofs 15147 +Number of constraints 425 +Number of unknowns 13597 +L2-norm : 0.00051814 +Max X-displacement : 0.00146856 node 425 +Max Y-displacement : 0.00329493 node 4652 +Max Z-displacement : 0.00644642 node 4200 +Energy norm |u^h| = a(u^h,u^h)^0.5 : 17.0665 +External energy ((f,u^h)+(t,u^h)^0.5 : 17.3112 diff --git a/Apps/LinearElasticity/Test/Cylinder-NURBS.reg b/Apps/LinearElasticity/Test/Cylinder-NURBS.reg new file mode 100644 index 00000000..be12c85d --- /dev/null +++ b/Apps/LinearElasticity/Test/Cylinder-NURBS.reg @@ -0,0 +1,13 @@ +Cylinder-NURBS.inp -checkRHS -nviz 5 + +Number of elements 64 +Number of nodes 1260 +Number of dofs 3780 +Number of constraints 160 +Number of unknowns 3197 +L2-norm : 6.74404e-06 +Max X-displacement : 1.85428e-05 node 222 +Max Y-displacement : 9.27156e-06 node 645 +Max Z-displacement : 2.17282e-18 node 580 +Energy norm |u^h| = a(u^h,u^h)^0.5 : 17.0665 +External energy ((f,u^h)+(t,u^h)^0.5 : 17.0665 diff --git a/Apps/LinearElasticity/Test/Cylinder-Spectral.reg b/Apps/LinearElasticity/Test/Cylinder-Spectral.reg new file mode 100644 index 00000000..699602ac --- /dev/null +++ b/Apps/LinearElasticity/Test/Cylinder-Spectral.reg @@ -0,0 +1,13 @@ +Cylinder-Spectral.inp -checkRHS -spectral + +Number of elements 64 +Number of nodes 5049 +Number of dofs 15147 +Number of constraints 425 +Number of unknowns 13597 +L2-norm : 6.68966e-06 +Max X-displacement : 1.85424e-05 node 3383 +Max Y-displacement : 9.27122e-06 node 570 +Max Z-displacement : 1.33734e-18 node 3926 +Energy norm |u^h| = a(u^h,u^h)^0.5 : 17.0665 +External energy ((f,u^h)+(t,u^h)^0.5 : 17.0665 diff --git a/Apps/LinearElasticity/Test/Hole2D-Lagrange.reg b/Apps/LinearElasticity/Test/Hole2D-Lagrange.reg new file mode 100644 index 00000000..52cd4fc2 --- /dev/null +++ b/Apps/LinearElasticity/Test/Hole2D-Lagrange.reg @@ -0,0 +1,14 @@ +Hole2D-Lagrange.inp -2D -lagrange + +Number of elements 32 +Number of nodes 325 +Number of dofs 650 +Number of unknowns 624 +L2-norm : 0.019797 +Max X-displacement : 0.0465164 node 325 +Max Y-displacement : 0.0152664 node 301 +Energy norm |u^h| = a(u^h,u^h)^0.5 : 1.29956 +External energy ((f,u^h)+(t,u^h)^0.5 : 1.29956 +Exact norm |u| = a(u,u)^0.5 : 1.29959 +Exact error a(e,e)^0.5, e=u-u^h : 0.0112431 +Exact relative error (%) : 0.865124 diff --git a/Apps/LinearElasticity/Test/Hole2D-NURBS.reg b/Apps/LinearElasticity/Test/Hole2D-NURBS.reg new file mode 100644 index 00000000..372d888e --- /dev/null +++ b/Apps/LinearElasticity/Test/Hole2D-NURBS.reg @@ -0,0 +1,14 @@ +Hole2D-NURBS.inp -2D -nviz 4 + +Number of elements 32 +Number of nodes 77 +Number of dofs 154 +Number of unknowns 140 +L2-norm : 0.0204072 +Max X-displacement : 0.0465281 node 77 +Max Y-displacement : 0.0152723 node 67 +Energy norm |u^h| = a(u^h,u^h)^0.5 : 1.29947 +External energy ((f,u^h)+(t,u^h)^0.5 : 1.29947 +Exact norm |u| = a(u,u)^0.5 : 1.29959 +Exact error a(e,e)^0.5, e=u-u^h : 0.0185057 +Exact relative error (%) : 1.42396 diff --git a/Apps/LinearElasticity/Test/Hole2D-Spectral.reg b/Apps/LinearElasticity/Test/Hole2D-Spectral.reg new file mode 100644 index 00000000..dfba88d2 --- /dev/null +++ b/Apps/LinearElasticity/Test/Hole2D-Spectral.reg @@ -0,0 +1,14 @@ +Hole2D-Spectral.inp -2D -spectral + +Number of elements 32 +Number of nodes 325 +Number of dofs 650 +Number of unknowns 624 +L2-norm : 0.0198122 +Max X-displacement : 0.0465176 node 325 +Max Y-displacement : 0.0152633 node 301 +Energy norm |u^h| = a(u^h,u^h)^0.5 : 1.29954 +External energy ((f,u^h)+(t,u^h)^0.5 : 1.29954 +Exact norm |u| = a(u,u)^0.5 : 1.29989 +Exact error a(e,e)^0.5, e=u-u^h : 0.0264407 +Exact relative error (%) : 2.03407 diff --git a/Apps/LinearElasticity/Test/PipeJoint-Lagrange.reg b/Apps/LinearElasticity/Test/PipeJoint-Lagrange.reg new file mode 100644 index 00000000..02d6f256 --- /dev/null +++ b/Apps/LinearElasticity/Test/PipeJoint-Lagrange.reg @@ -0,0 +1,12 @@ +PipeJoint-Lagrange.inp -lagrange + +Number of elements 12 +Number of nodes 166 +Number of dofs 498 +Number of unknowns 402 +L2-norm : 0.0672723 +Max X-displacement : 0.297278 node 152 +Max Y-displacement : 0.0947172 node 125 +Max Z-displacement : 0.0110647 node 78 +Energy norm |u^h| = a(u^h,u^h)^0.5 : 41532.7 +External energy ((f,u^h)+(t,u^h)^0.5 : 41532.7 diff --git a/Apps/LinearElasticity/Test/PipeJoint-NURBS.reg b/Apps/LinearElasticity/Test/PipeJoint-NURBS.reg new file mode 100644 index 00000000..66133372 --- /dev/null +++ b/Apps/LinearElasticity/Test/PipeJoint-NURBS.reg @@ -0,0 +1,12 @@ +PipeJoint-NURBS.inp -nu 7 -nv 7 + +Number of elements 12 +Number of nodes 166 +Number of dofs 498 +Number of unknowns 402 +L2-norm : 0.0707423 +Max X-displacement : 0.295694 node 152 +Max Y-displacement : 0.100096 node 3 +Max Z-displacement : 0.0302177 node 78 +Energy norm |u^h| = a(u^h,u^h)^0.5 : 41649 +External energy ((f,u^h)+(t,u^h)^0.5 : 41649 diff --git a/Apps/LinearElasticity/Test/PipeJoint-vibration.reg b/Apps/LinearElasticity/Test/PipeJoint-vibration.reg new file mode 100644 index 00000000..00badeac --- /dev/null +++ b/Apps/LinearElasticity/Test/PipeJoint-vibration.reg @@ -0,0 +1,38 @@ +PipeJoint-vibration.inp -nu 7 -nv 7 -free -eig 4 -nev 16 -ncv 32 + +Number of elements 12 +Number of nodes 166 +Number of dofs 498 +Number of unknowns 498 + 1 -6.24427e-06 + 2 -4.26166e-06 + 3 -3.90673e-06 + 4 -2.26004e-06 + 5 4.29228e-07 + 6 4.98672e-06 + 7 7.45855 + 8 7.80118 + 9 11.7379 + 10 13.5283 + 11 15.9218 + 12 16.62 + 13 21.4777 + 14 23.4314 + 15 27.2659 + 16 29.3211 + Row 1: -1.53930D-09 2.89397D+04 + Row 2: -7.16996D-10 1.41223D+04 + Row 3: -6.02542D-10 3.29836D+04 + Row 4: -2.01646D-10 7.22619D+04 + Row 5: 7.27336D-12 1.09739D+06 + Row 6: 9.81725D-10 1.57573D+04 + Row 7: 2.19619D+03 1.84106D-07 + Row 8: 2.40260D+03 4.90235D-07 + Row 9: 5.43926D+03 2.56335D-08 + Row 10: 7.22517D+03 2.05575D-07 + Row 11: 1.00079D+04 1.32816D-08 + Row 12: 1.09048D+04 2.90698D-07 + Row 13: 1.82111D+04 1.72809D-08 + Row 14: 2.16749D+04 3.25351D-09 + Row 15: 2.93495D+04 8.51679D-08 + Row 16: 3.39407D+04 4.22339D-08 diff --git a/Apps/LinearElasticity/Test/SquarePlate-Lagrange.reg b/Apps/LinearElasticity/Test/SquarePlate-Lagrange.reg new file mode 100644 index 00000000..c0613958 --- /dev/null +++ b/Apps/LinearElasticity/Test/SquarePlate-Lagrange.reg @@ -0,0 +1,33 @@ +SquarePlate-Lagrange.inp -eig 5 -nev 20 -ncv 40 -shift 2.0e-4 -nGauss 3 -lagrange + +Number of elements 49 +Number of nodes 675 +Number of dofs 2025 +Number of unknowns 1966 +L2-norm : 3.24332 +Max X-displacement : 9.15751 node 585 +Max Y-displacement : 2.74725 node 436 +Max Z-displacement : 0.0137363 node 83 +Energy norm |u^h| = a(u^h,u^h)^0.5 : 9.56949 +External energy ((f,u^h)+(t,u^h)^0.5 : 9.56949 + Mode Eigenvalue + 1 0.000397498 + 2 0.000643834 + 3 0.00123561 + 4 0.0016299 + 5 0.00199837 + 6 0.00221839 + 7 0.00257798 + 8 0.00289996 + 9 0.00365368 + 10 0.00382284 + 11 0.00429388 + 12 0.00434341 + 13 0.00451961 + 14 0.00529737 + 15 0.00555164 + 16 0.00591268 + 17 0.00615693 + 18 0.00676318 + 19 0.00706523 + 20 0.00719485 diff --git a/Apps/LinearElasticity/Test/SquarePlate-Spectral.reg b/Apps/LinearElasticity/Test/SquarePlate-Spectral.reg new file mode 100644 index 00000000..b947d5aa --- /dev/null +++ b/Apps/LinearElasticity/Test/SquarePlate-Spectral.reg @@ -0,0 +1,33 @@ +SquarePlate-Spectral.inp -eig 5 -nev 20 -ncv 40 -shift 2.0e-4 -nGauss 3 -spectral + +Number of elements 49 +Number of nodes 675 +Number of dofs 2025 +Number of unknowns 1966 +L2-norm : 3.24332 +Max X-displacement : 9.15751 node 15 +Max Y-displacement : 2.74725 node 675 +Max Z-displacement : 0.0137363 node 141 +Energy norm |u^h| = a(u^h,u^h)^0.5 : 9.56949 +External energy ((f,u^h)+(t,u^h)^0.5 : 9.56949 + Mode Eigenvalue + 1 0.000397885 + 2 0.000646211 + 3 0.00124808 + 4 0.00163378 + 5 0.00201232 + 6 0.00225966 + 7 0.00258407 + 8 0.00294378 + 9 0.0037461 + 10 0.0038357 + 11 0.00439048 + 12 0.00439077 + 13 0.00452341 + 14 0.00543184 + 15 0.00566056 + 16 0.00605423 + 17 0.00633285 + 18 0.00694727 + 19 0.00720034 + 20 0.00723013 diff --git a/Apps/LinearElasticity/Test/SquarePlate-Splines.reg b/Apps/LinearElasticity/Test/SquarePlate-Splines.reg new file mode 100644 index 00000000..74da09da --- /dev/null +++ b/Apps/LinearElasticity/Test/SquarePlate-Splines.reg @@ -0,0 +1,33 @@ +SquarePlate-Splines.inp -eig 5 -nev 20 -ncv 40 -shift 2.0e-4 -nGauss 3 -nviz 3 + +Number of elements 49 +Number of nodes 243 +Number of dofs 729 +Number of unknowns 694 +L2-norm : 3.3533 +Max X-displacement : 9.15751 node 198 +Max Y-displacement : 2.74725 node 154 +Max Z-displacement : 0.0137363 node 51 +Energy norm |u^h| = a(u^h,u^h)^0.5 : 9.56949 +External energy ((f,u^h)+(t,u^h)^0.5 : 9.56949 + Mode Eigenvalue + 1 0.000417151 + 2 0.000845558 + 3 0.00203991 + 4 0.00270478 + 5 0.00335392 + 6 0.0036516 + 7 0.00678568 + 8 0.00809802 + 9 0.00942794 + 10 0.0101638 + 11 0.0125943 + 12 0.0211415 + 13 0.0219982 + 14 0.0254907 + 15 0.0320796 + 16 0.032728 + 17 0.0345402 + 18 0.0417065 + 19 0.0436573 + 20 0.0618522 diff --git a/Apps/LinearElasticity/Test/run.sh b/Apps/LinearElasticity/Test/run.sh deleted file mode 100755 index 6658004d..00000000 --- a/Apps/LinearElasticity/Test/run.sh +++ /dev/null @@ -1,57 +0,0 @@ -#!/bin/sh -# $Id$ -################################################################## -# This script defines a set of sample simulation cases that -# is used to verify the integrity of an IFEM-based simulator. -# Copy this file to a sub-folder Test in your App-directory and -# insert the simulations that you want to use as regression tests. -################################################################## - -# Define the name of the executable here -mysim=LinEl - -run () { -# This function runs a simulation with the specified options, -# pipes the terminal output to a log-file, and compares it -# with a previous simulation stored in the Reference folder. - inp=$1 - log=`basename $1 .inp`.log - echo Running $inp ... - shift - time -f "real time %E, user time %U, system time %S" \ - ../../../Release/bin/$mysim $inp $* > $log - if [ ! -e Reference/$log ]; then - mv $log Reference - elif cmp -s $log Reference/$log; then - echo Ok - else - echo "Warning: Discrepancies between current run and reference." - diff $log Reference - fi -} - -if [ ! -d Reference ]; then mkdir Reference; fi - -##################################### -# Enter the various cases below: -# Format: run [] -##################################### - -run Hole2D-NURBS.inp -2D -vtf 1 -nviz 4 -run Hole2D-Lagrange.inp -2D -vtf 1 -lagrange -run Hole2D-Spectral.inp -2D -vtf 1 -spectral - -run Cylinder-NURBS.inp -checkRHS -vtf 1 -nviz 5 -run Cylinder-Lagrange.inp -checkRHS -vtf 1 -lagrange -run Cylinder-Spectral.inp -checkRHS -vtf 1 -spectral - -run Cylinder-Axisymm.inp -2Daxisymm -vtf 1 -nviz 5 - -eigOpt="-eig 5 -nev 20 -ncv 40 -shift 2.0e-4" -run SquarePlate-Splines.inp $eigOpt -nGauss 3 -vtf 1 -nviz 3 -run SquarePlate-Lagrange.inp $eigOpt -nGauss 3 -vtf 1 -lagrange -run SquarePlate-Spectral.inp $eigOpt -nGauss 3 -vtf 1 -spectral - -run PipeJoint-vibration.inp -vtf 1 -nu 7 -nv 7 -free -eig 4 -nev 16 -ncv 32 -run PipeJoint-NURBS.inp -vtf 1 -nu 7 -nv 7 -run PipeJoint-Lagrange.inp -vtf 1 -lagrange diff --git a/CMakeLists.txt b/CMakeLists.txt index 14b0b912..095c895b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -21,6 +21,8 @@ ELSE(CMAKE_CXX_COMPILER MATCHES icpc) SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DUSE_CBLAS") ENDIF(CMAKE_CXX_COMPILER MATCHES icpc) +ENABLE_TESTING() + # Add local modules set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake/Modules) @@ -141,6 +143,17 @@ FILE(GLOB_RECURSE LinEl_SRCS ADD_EXECUTABLE(LinEl ${LinEl_SRCS}) TARGET_LINK_LIBRARIES(LinEl IFEM ${DEPLIBS}) +# Tests +FILE(GLOB_RECURSE LINEL_TESTFILES "${PROJECT_SOURCE_DIR}/Apps/LinearElasticity/Test/*.reg") +FOREACH(TESTFILE ${LINEL_TESTFILES}) + ADD_TEST(${TESTFILE} ${PROJECT_SOURCE_DIR}/test/regtest.sh "${CMAKE_BINARY_DIR}/${EXECUTABLE_OUTPUT_PATH}/LinEl" "${TESTFILE}") +ENDFOREACH() + +FILE(GLOB_RECURSE POISSON_TESTFILES "${PROJECT_SOURCE_DIR}/Apps/Poisson/Test/*.reg") +FOREACH(TESTFILE ${POISSON_TESTFILES}) + ADD_TEST(${TESTFILE} ${PROJECT_SOURCE_DIR}/test/regtest.sh "${CMAKE_BINARY_DIR}/${EXECUTABLE_OUTPUT_PATH}/Poisson" "${TESTFILE}") +ENDFOREACH() + IF(NOT IFEM_INSTALL_PREFIX) SET(IFEM_INSTALL_PREFIX $ENV{HOME}) ENDIF(NOT IFEM_INSTALL_PREFIX)