Commit 405530d3 authored by K Devine's avatar K Devine

Merge branch 'master' of github.com:trilinos/Trilinos

parents 1dba26ef 9cdf0859
......@@ -5,6 +5,7 @@
[Mailing List](https://trilinos.org/mailman/listinfo/trilinos-users) |
[Packages](http://trilinos.org/packages/)
[![Stories in Ready](https://badge.waffle.io/trilinos/Trilinos.png?label=ready&title=Ready)](https://waffle.io/trilinos/Trilinos)
[![Coverity Scan
Build](https://scan.coverity.com/projects/1680/badge.svg)](https://scan.coverity.com/projects/1680)
......
......@@ -65,7 +65,7 @@ SET(BUILD_TYPE RELEASE)
SET(BUILD_DIR_NAME MPI_RELEASE_DEV_DownStream_ETI_SERIAL-$ENV{JENKINS_DO_SERIAL}_OPENMP-$ENV{JENKINS_DO_OPENMP}_PTHREAD-$ENV{JENKINS_DO_PTHREAD}_CUDA-$ENV{JENKINS_DO_CUDA}_COMPLEX-$ENV{JENKINS_DO_COMPLEX})
SET(CTEST_PARALLEL_LEVEL 1)
SET(CTEST_TEST_TYPE $ENV{JENKINS_JOB_TYPE})
SET(CTEST_TEST_TIMEOUT 900)
SET(CTEST_TEST_TIMEOUT 300)
SET(Trilinos_PACKAGES Kokkos Tpetra Belos Ifpack2 MueLu Amesos Amesos2 Ifpack Epetra EpetraExt Zoltan Zoltan2 Xpetra Panzer Intrepid STK Seacas Anasazi Phalanx Sacado Stokhos Shylu Stratimikos Thyra)
......
# @HEADER
# ************************************************************************
#
# Trilinos: An Object-Oriented Solver Framework
# Copyright (2001) Sandia Corporation
#
#
# Copyright (2001) Sandia Corporation. Under the terms of Contract
# DE-AC04-94AL85000, there is a non-exclusive license for use of this
# work by or on behalf of the U.S. Government. Export of this program
# may require a license from the United States Government.
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# 3. Neither the name of the Corporation nor the names of the
# contributors may be used to endorse or promote products derived from
# this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# NOTICE: The United States Government is granted for itself and others
# acting on its behalf a paid-up, nonexclusive, irrevocable worldwide
# license in this data to reproduce, prepare derivative works, and
# perform publicly and display publicly. Beginning five (5) years from
# July 25, 2001, the United States Government is granted for itself and
# others acting on its behalf a paid-up, nonexclusive, irrevocable
# worldwide license in this data to reproduce, prepare derivative works,
# distribute copies to the public, perform publicly and display
# publicly, and to permit others to do so.
#
# NEITHER THE UNITED STATES GOVERNMENT, NOR THE UNITED STATES DEPARTMENT
# OF ENERGY, NOR SANDIA CORPORATION, NOR ANY OF THEIR EMPLOYEES, MAKES
# ANY WARRANTY, EXPRESS OR IMPLIED, OR ASSUMES ANY LEGAL LIABILITY OR
# RESPONSIBILITY FOR THE ACCURACY, COMPLETENESS, OR USEFULNESS OF ANY
# INFORMATION, APPARATUS, PRODUCT, OR PROCESS DISCLOSED, OR REPRESENTS
# THAT ITS USE WOULD NOT INFRINGE PRIVATELY OWNED RIGHTS.
#
# ************************************************************************
# @HEADER
INCLUDE("${CTEST_SCRIPT_DIRECTORY}/TrilinosCTestDriverCore.linux.gcc-4.4.cmake")
#
# Set the options specific to this build case
#
SET(COMM_TYPE MPI)
SET(BUILD_TYPE RELEASE)
SET(BUILD_DIR_NAME MPI_OPT_DEV_XYCE)
#SET(CTEST_TEST_TIMEOUT 900)
#SET(Trilinos_ENABLE_SECONDARY_STABLE_CODE ON)
SET( Trilinos_EXCLUDE_PACKAGES ${EXTRA_EXCLUDE_PACKAGES} PyTrilinos Kokkos Gtest ThreadPool RTOp Shards Thyra Xpetra Galeri Pamgen ML SEACAS Anasazi Stratimikos FEI Intrepid STK MueLu)
SET(Trilinos_PACKAGES NOX EpetraExt TrilinosCouplings Ifpack Isorropia AztecOO Belos Teuchos Amesos Sacado Zoltan Epetra Triutils)
SET( EXTRA_CONFIGURE_OPTIONS
"-DEpetraExt_BUILD_BTF=ON"
"-DTeuchos_ENABLE_COMPLEX=ON"
"-DNOX_ENABLE_LOCA=ON"
"-DTPL_ENABLE_ParMETIS:BOOL=OFF"
"-DParMETIS_LIBRARY_DIRS=/home/trilinos/tpl/gcc4.7.2/ParMETIS-4.0.3_32bit/lib"
"-DParMETIS_INCLUDE_DIRS=/home/trilinos/tpl/gcc4.7.2/ParMETIS-4.0.3_32bit/include"
"-DTrilinos_ENABLE_ALL_OPTIONAL_PACKAGES=OFF"
"-DTrilinos_ENABLE_ALL_PACKAGES:BOOL=OFF"
)
#
# Set the rest of the system-specific options and run the dashboard build/test
#
TRILINOS_SYSTEM_SPECIFIC_CTEST_DRIVER()
# @HEADER
# ************************************************************************
#
# Trilinos: An Object-Oriented Solver Framework
# Copyright (2001) Sandia Corporation
#
#
# Copyright (2001) Sandia Corporation. Under the terms of Contract
# DE-AC04-94AL85000, there is a non-exclusive license for use of this
# work by or on behalf of the U.S. Government. Export of this program
# may require a license from the United States Government.
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# 3. Neither the name of the Corporation nor the names of the
# contributors may be used to endorse or promote products derived from
# this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# NOTICE: The United States Government is granted for itself and others
# acting on its behalf a paid-up, nonexclusive, irrevocable worldwide
# license in this data to reproduce, prepare derivative works, and
# perform publicly and display publicly. Beginning five (5) years from
# July 25, 2001, the United States Government is granted for itself and
# others acting on its behalf a paid-up, nonexclusive, irrevocable
# worldwide license in this data to reproduce, prepare derivative works,
# distribute copies to the public, perform publicly and display
# publicly, and to permit others to do so.
#
# NEITHER THE UNITED STATES GOVERNMENT, NOR THE UNITED STATES DEPARTMENT
# OF ENERGY, NOR SANDIA CORPORATION, NOR ANY OF THEIR EMPLOYEES, MAKES
# ANY WARRANTY, EXPRESS OR IMPLIED, OR ASSUMES ANY LEGAL LIABILITY OR
# RESPONSIBILITY FOR THE ACCURACY, COMPLETENESS, OR USEFULNESS OF ANY
# INFORMATION, APPARATUS, PRODUCT, OR PROCESS DISCLOSED, OR REPRESENTS
# THAT ITS USE WOULD NOT INFRINGE PRIVATELY OWNED RIGHTS.
#
# ************************************************************************
# @HEADER
INCLUDE("${CTEST_SCRIPT_DIRECTORY}/../../TrilinosCTestDriverCore.cmake")
#
# Platform/compiler specific options for trilinos-test using gcc
#
MACRO(TRILINOS_SYSTEM_SPECIFIC_CTEST_DRIVER)
# Base of Trilinos/cmake/ctest then BUILD_DIR_NAME
SET( CTEST_DASHBOARD_ROOT "${TRILINOS_CMAKE_DIR}/../../${BUILD_DIR_NAME}" )
SET( CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}" )
SET_DEFAULT( CTEST_BUILD_FLAGS "-j8 -i" )
SET_DEFAULT( CTEST_PARALLEL_LEVEL "8" )
SET( CTEST_COVERAGE_COMMAND /usr/bin/gcov )
SET( CTEST_MEMORYCHECK_COMMAND /usr/bin/valgrind )
SET_DEFAULT( Trilinos_ENABLE_SECONDARY_STABLE_CODE OFF)
# Only turn on PyTrilinos for shared libraries
SET_DEFAULT( Trilinos_EXCLUDE_PACKAGES ${EXTRA_EXCLUDE_PACKAGES} TriKota)
SET( EXTRA_SYSTEM_CONFIGURE_OPTIONS
"-DCMAKE_BUILD_TYPE:STRING=${BUILD_TYPE}"
"-DCOVERAGE_COMMAND:FILEPATH=/usr/bin/gcov"
"-DMEMORYCHECK_COMMAND:FILEPATH=/usr/bin/valgrind"
"-DTrilinos_ENABLE_TriKota:BOOL=OFF"
"-DCMAKE_VERBOSE_MAKEFILE:BOOL=TRUE"
"-DTPL_ENABLE_Matio=OFF"
"-DTrilinos_ENABLE_CXX11=OFF"
"-DCMAKE_MAKE_PROGRAM=make"
"-DCMAKE_CXX_FLAGS='-O3 -fPIC'"
"-DCMAKE_C_FLAGS='-O3 -fPIC'"
)
IF (BUILD_TYPE STREQUAL "DEBUG")
SET( EXTRA_SYSTEM_CONFIGURE_OPTIONS
${EXTRA_SYSTEM_CONFIGURE_OPTIONS}
"-DTrilinos_ENABLE_DEBUG:BOOL=ON"
)
ENDIF()
SET_DEFAULT(COMPILER_VERSION "GCC-4.4.7")
IF (COMM_TYPE STREQUAL MPI)
SET(TPL_ENABLE_MPI ON)
SET( EXTRA_SYSTEM_CONFIGURE_OPTIONS
${EXTRA_SYSTEM_CONFIGURE_OPTIONS}
"-DTPL_ENABLE_MPI:BOOL=ON"
"-DCMAKE_C_COMPILER=/usr/lib64/openmpi/bin/mpicc"
"-DCMAKE_CXX_COMPILER=/usr/lib64/openmpi/bin/mpic++"
"-DCMAKE_Fortran_COMPILER=/usr/lib64/openmpi/bin/mpif77"
"-DMPI_EXEC=/usr/lib64/openmpi/bin/mpiexec"
)
# "-DMPI_BASE_DIR:PATH=/home/trilinos/gcc4.7.2/openmpi-1.6.5"
# )
SET( CTEST_MEMORYCHECK_COMMAND_OPTIONS
"--trace-children=yes --gen-suppressions=all --suppressions=${CTEST_SCRIPT_DIRECTORY}/valgrind_suppressions_trilinos-test_openmpi_1.2.7.txt ${CTEST_MEMORYCHECK_COMMAND_OPTIONS}" )
ELSE()
# SET( EXTRA_SYSTEM_CONFIGURE_OPTIONS
# ${EXTRA_SYSTEM_CONFIGURE_OPTIONS}
# "-DCMAKE_CXX_COMPILER:FILEPATH=/home/trilinos/gcc4.7.2/base/bin/g++"
# "-DCMAKE_C_COMPILER:FILEPATH=/home/trilinos/gcc4.7.2/base/bin/gcc"
# "-DCMAKE_Fortran_COMPILER:FILEPATH=/home/trilinos/gcc4.7.2/base/bin/gfortran"
# )
SET( CTEST_MEMORYCHECK_COMMAND_OPTIONS
"--trace-children=yes --gen-suppressions=all --suppressions=${CTEST_SCRIPT_DIRECTORY}/valgrind_suppressions_trilinos-test_gcc-4.1.2.txt ${CTEST_MEMORYCHECK_COMMAND_OPTIONS}" )
ENDIF()
TRILINOS_CTEST_DRIVER()
ENDMACRO()
......@@ -54,7 +54,7 @@
# @HEADER
INCLUDE("${CTEST_SCRIPT_DIRECTORY}/TrilinosCTestDriverCore.perseus.generic.cmake")
INCLUDE("${CTEST_SCRIPT_DIRECTORY}/TrilinosCTestDriverCore.shiller.generic.cmake")
#
# Set the options specific to this build case
......
......@@ -616,7 +616,7 @@ void Relaxation<MatrixType>::computeBlockCrs ()
blockDiag_ = block_diag_type (); // clear it before reallocating
blockDiag_ = block_diag_type ("Ifpack2::Relaxation::blockDiag_",
lclNumMeshRows, blockSize, blockSize);
if (diagOffsets_.dimension_0 () < lclNumMeshRows) {
if (Teuchos::as<LO>(diagOffsets_.dimension_0 () ) < lclNumMeshRows) {
typedef typename node_type::device_type DT;
diagOffsets_ = Kokkos::View<size_t*, DT> (); // clear first to save mem
diagOffsets_ = Kokkos::View<size_t*, DT> ("offsets", lclNumMeshRows);
......
SET(LIB_REQUIRED_DEP_PACKAGES Teuchos Shards Sacado)
SET(LIB_OPTIONAL_DEP_PACKAGES KokkosCore KokkosAlgorithms)
SET(TEST_REQUIRED_DEP_PACKAGES)
SET(TEST_REQUIRED_DEP_PACKAGES Gtest)
SET(TEST_OPTIONAL_DEP_PACKAGES Epetra EpetraExt Amesos Pamgen)
SET(LIB_REQUIRED_DEP_TPLS)
SET(LIB_OPTIONAL_DEP_TPLS Boost)
......
......@@ -123,6 +123,8 @@ IF (Intrepid_ENABLE_Boost)
Shared/MiniTensor/Intrepid_MiniTensor_Matrix.h
Shared/MiniTensor/Intrepid_MiniTensor_Matrix.i.h
Shared/MiniTensor/Intrepid_MiniTensor_Matrix.t.h
Shared/MiniTensor/Intrepid_MiniTensor_Solvers.h
Shared/MiniTensor/Intrepid_MiniTensor_Solvers.t.h
Shared/MiniTensor/Intrepid_MiniTensor_Storage.h
Shared/MiniTensor/Intrepid_MiniTensor_Storage.i.h
Shared/MiniTensor/Intrepid_MiniTensor_Tensor.h
......
......@@ -249,14 +249,6 @@ template<typename T, Index N>
Tensor<T, N>
log_rotation_pi(Tensor<T, N> const & R);
///
/// Gaussian Elimination with partial pivot
/// \return \f$ xvec \f$
///
template<typename T, Index N>
Tensor<T, N>
gaussian_elimination(Tensor<T, N> const & A);
///
/// Apply Givens-Jacobi rotation on the left in place.
/// \param c and s for a rotation G in form [c, s; -s, c]
......
......@@ -712,7 +712,7 @@ Tensor<T, N>
log_gregory(Tensor<T, N> const & A)
{
Index const
max_iter = 128;
max_iter = 8192;
T const
tol = machine_epsilon<T>();
......@@ -898,33 +898,38 @@ log_rotation_pi(Tensor<T, N> const & R)
case 3:
{
// obtain U from R = LU
r = gaussian_elimination((R - identity<T, N>(3)));
Vector<T, N>
normal(3);
// backward substitution (for rotation exp(R) only)
T const tol = 10.0 * machine_epsilon<T>();
Tensor<T, N> const
B = R - identity<T, N>(3);
Vector<T, N> normal(3);
Vector<T, N> const
u = row(B, 0);
if (std::abs(r(2,2)) < tol){
normal(2) = 1.0;
} else {
normal(2) = 0.0;
}
Vector<T, N> const
v = row(B, 1);
if (std::abs(r(1,1)) < tol){
normal(1) = 1.0;
} else {
normal(1) = -normal(2)*r(1,2)/r(1,1);
}
normal = cross(u, v);
if (norm(normal) < machine_epsilon<T>()) {
Vector<T, N> const
w = row(B, 2);
normal = cross(u, w);
if (norm(normal) < machine_epsilon<T>()) {
std::cerr << "ERROR: " << __PRETTY_FUNCTION__;
std::cerr << std::endl;
std::cerr << "Cannot determine rotation vector of rotation.";
std::cerr << std::endl;
exit(1);
}
if (std::abs(r(0,0)) < tol){
normal(0) = 1.0;
} else {
normal(0) = -normal(1)*r(0,1) - normal(2)*r(0,2)/r(0,0);
}
normal = normal / norm(normal);
normal = unit(normal);
r.fill(ZEROS);
r(0,1) = -normal(2);
......@@ -934,7 +939,8 @@ log_rotation_pi(Tensor<T, N> const & R)
r(2,0) = -normal(1);
r(2,1) = normal(0);
T const pi = std::acos(-1.0);
T const
pi = std::acos(-1.0);
r = pi * r;
}
......@@ -960,61 +966,6 @@ log_rotation_pi(Tensor<T, N> const & R)
return r;
}
// Gaussian Elimination with partial pivot
// \param matrix \f$ A \f$
// \return \f$ U \f$ where \f$ A = LU \f$
//
template<typename T, Index N>
Tensor<T, N>
gaussian_elimination(Tensor<T, N> const & A)
{
Index const
dimension = A.get_dimension();
Tensor<T, N>
U = A;
T const
tol = 10.0 * machine_epsilon<T>();
Index i = 0;
Index j = 0;
Index i_max = 0;
while ((i < dimension) && (j < dimension)) {
// find pivot in column j, starting in row i
i_max = i;
for (Index k = i + 1; k < dimension; ++k) {
if (std::abs(U(k,j)) > std::abs(U(i_max,j))) {
i_max = k;
}
}
// Check if A(i_max,j) equal to or very close to 0
if (std::abs(U(i_max,j)) > tol){
// swap rows i and i_max and divide each entry in row i
// by U(i,j)
for (Index k = 0; k < dimension; ++k) {
std::swap(U(i,k), U(i_max,k));
}
for (Index k = 0; k < dimension; ++k) {
U(i,k) = U(i,k) / U(i,j);
}
for (Index l = i + 1; l < dimension; ++l) {
for (Index k = 0; k < dimension; ++k) {
U(l,k) = U(l,k) - U(l,i) * U(i,k) / U(i,i);
}
}
++i;
}
++j;
}
return U;
}
//
// Apply Givens-Jacobi rotation on the left in place.
//
......
......@@ -645,7 +645,9 @@ check_strong_ellipticity(Tensor4<T, N> const & A)
dimension = A.get_dimension();
Vector<T, N>
eigenvector(dimension, 1.0 / dimension);
eigenvector(dimension, ONES);
eigenvector /= dimension;
Index const
maximum_iterarions = 128;
......@@ -669,7 +671,7 @@ check_strong_ellipticity(Tensor4<T, N> const & A)
while (error > tolerance && iteration < maximum_iterarions) {
Tensor<T, N>
Q = dot(eigenvector, dot(A, eigenvector));
Q = dot2(eigenvector, dot(A, eigenvector));
Tensor<T, N>
V;
......
//*****************************************************************//
// Albany 2.0: Copyright 2012 Sandia Corporation //
// This Software is released under the BSD license detailed //
// in the file "license.txt" in the top-level Albany directory //
//*****************************************************************//
#if !defined(Intrepid_MiniTensor_Solvers_h)
#define Intrepid_MiniTensor_Solvers_h
#include <memory>
#include <utility>
#include <Intrepid_MiniTensor.h>
namespace Intrepid
{
/// The Fad type to use.
template<typename T, int N>
using FAD = Sacado::Fad::SLFad<T, N>;
///
/// Function base class that defines the interface to Mini Solvers.
///
template<typename FunctionDerived, typename S>
class Function_Base
{
public:
Function_Base()
{
}
///
/// By default use merit function 0.5 dot(gradient, gradient)
/// as the target to optimize if only the gradient is provided.
///
template<typename T, Index N>
T
value(FunctionDerived & f, Vector<T, N> const & x);
///
/// By default compute gradient with AD from value().
///
template<typename T, Index N>
Vector<T, N>
gradient(FunctionDerived & f, Vector<T, N> const & x);
///
/// By default compute Hessian with AD from gradient().
///
template<typename T, Index N>
Tensor<T, N>
hessian(FunctionDerived & f, Vector<T, N> const & x);