Skip to content

Commit

Permalink
Revert "Intrepid2: Vector adaptor for ROL functional. Add test for ad…
Browse files Browse the repository at this point in the history
…aptor."

This reverts commit b1bfe01.
  • Loading branch information
lxmota committed Aug 24, 2016
1 parent 43a849f commit 39658dc
Show file tree
Hide file tree
Showing 10 changed files with 12 additions and 214 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ enum ComponentValue {
ZEROS,
ONES,
SEQUENCE,
RANDOM,
RANDOM_UNIFORM,
RANDOM_NORMAL,
NANS
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -412,14 +412,6 @@ TensorBase<T, ST>::fill(ComponentValue const value)
}
break;

case RANDOM:
for (Index i = 0; i < number_components; ++i) {
auto & entry = (*this)[i];
fill_AD<T>(entry, Teuchos::ScalarTraits<S>::zero());
entry = random<T>();
}
break;

case RANDOM_NORMAL:
for (Index i = 0; i < number_components; ++i) {
auto & entry = (*this)[i];
Expand Down
2 changes: 1 addition & 1 deletion packages/intrepid2/cmake/Dependencies.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
SET(LIB_REQUIRED_DEP_PACKAGES Teuchos Shards Sacado KokkosCore KokkosContainers KokkosAlgorithms)
SET(LIB_OPTIONAL_DEP_PACKAGES Rol)
SET(LIB_OPTIONAL_DEP_PACKAGES)
SET(TEST_REQUIRED_DEP_PACKAGES Gtest)
SET(TEST_OPTIONAL_DEP_PACKAGES Epetra EpetraExt Amesos Pamgen)
SET(LIB_REQUIRED_DEP_TPLS)
Expand Down
3 changes: 0 additions & 3 deletions packages/intrepid2/cmake/Intrepid2_config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,3 @@
/* Define if want to build with sacado enabled */
#cmakedefine HAVE_INTREPID2_SACADO

/* Define if want to build with rol enabled */
#cmakedefine HAVE_INTREPID2_ROL

11 changes: 0 additions & 11 deletions packages/intrepid2/core/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -119,17 +119,6 @@ IF (Intrepid2_ENABLE_Boost)
)
IF (Intrepid2_ENABLE_ROL)
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/Shared/MiniTensor/rol)
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}/../../../rol/src)
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../../../rol/src)
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../../../rol/src/algorithm)
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../../../rol/src/elementwise)
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../../../rol/src/function)
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../../../rol/src/sol)
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../../../rol/src/status)
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../../../rol/src/step)
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../../../rol/src/utils)
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../../../rol/src/vector)
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../../../rol/src/zoo)
APPEND_SET(HEADERS ${HEADERS}
Shared/MiniTensor/rol/Intrepid2_MiniTensor_ROL_Vector.h
Shared/MiniTensor/rol/Intrepid2_MiniTensor_ROL_Vector.t.h
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ enum ComponentValue {
ZEROS,
ONES,
SEQUENCE,
RANDOM,
RANDOM_UNIFORM,
RANDOM_NORMAL,
NANS
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -409,14 +409,6 @@ TensorBase<T, ST>::fill(ComponentValue const value)
}
break;

case RANDOM:
for (Index i = 0; i < number_components; ++i) {
auto & entry = (*this)[i];
fill_AD<T>(entry, Teuchos::ScalarTraits<S>::zero());
entry = random<T>();
}
break;

case RANDOM_UNIFORM:
for (Index i = 0; i < number_components; ++i) {
auto & entry = (*this)[i];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,17 @@
// ************************************************************************
// @HEADER

#if defined(ENABLE_ROL)
#if !defined(Intrepid2_MiniTensor_ROL_Vector_h)
#define Intrepid2_MiniTensor_ROL_Vector_h

#include <Intrepid2_MiniTensor.h>
#include <vector/ROL_Vector.hpp>
#include "ROL_Vector.hpp"

namespace ROL
{

template <typename T, Intrepid2::Index N>
template <typename T, Index N>
class MiniTensorVector : public Vector<T> {

using uint = Intrepid2::Index;
Expand All @@ -65,12 +66,6 @@ class MiniTensorVector : public Vector<T> {
return;
}

virtual
~MiniTensorVector()
{
return;
}

void
set(Vector<T> const & x)
{
Expand Down Expand Up @@ -99,7 +94,7 @@ class MiniTensorVector : public Vector<T> {
auto const
dim = xval.get_dimension();

for (auto i = 0; i < dim; ++i) {
for (auto const i = 0; i < dim; ++i) {
vector_(i) += xval(i);
}
}
Expand All @@ -120,7 +115,7 @@ class MiniTensorVector : public Vector<T> {

assert(vector_.get_dimension() == dim);

for (auto i = 0; i < dim; ++i) {
for (auto const i = 0; i < dim); ++i) {
vector_(i) += alpha * xval(i);
}
}
Expand All @@ -131,7 +126,7 @@ class MiniTensorVector : public Vector<T> {
auto const
dim = vector_.get_dimension();

for (auto i = 0; i < dim; ++i) {
for (auto const i = 0; i < dim); ++i) {
vector_(i) *= alpha;
}
}
Expand Down Expand Up @@ -204,14 +199,14 @@ class MiniTensorVector : public Vector<T> {
int
dimension() const
{
return static_cast<int>(vector_.get_dimension());
return static_cast<int>(vector_->get_dimension());
}

void
applyUnary(Elementwise::UnaryFunction<T> const & f)
{
auto const
dim = vector_.get_dimension();
dim = vector_->get_dimension();

for(auto i{0}; i < dim; ++i) {
vector_(i) = f.apply(vector_(i));
Expand All @@ -228,7 +223,7 @@ class MiniTensorVector : public Vector<T> {
xval = ex.getVector();

auto const
dim = vector_.get_dimension();
dim = vector_->get_dimension();

for(auto i{0}; i < dim; ++i) {
vector_(i) = f.apply(vector_(i), xval(i));
Expand All @@ -242,7 +237,7 @@ class MiniTensorVector : public Vector<T> {
result = r.initialValue();

auto const
dim = vector_.get_dimension();
dim = vector_->get_dimension();

for(auto i{0}; i < dim; ++i) {
r.reduce(vector_(i), result);
Expand All @@ -257,3 +252,4 @@ class MiniTensorVector : public Vector<T> {
#include "Intrepid2_MiniTensor_ROL_Vector.t.h"

#endif // Intrepid2_MiniTensor_ROL_Vector_h
#endif // ENABLE_ROL
12 changes: 0 additions & 12 deletions packages/intrepid2/core/test/Shared/MiniTensor/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,3 @@ TRIBITS_ADD_EXECUTABLE_AND_TEST(
PASS_REGULAR_EXPRESSION "PASSED"
ADD_DIR_TO_NAME
)

IF (Intrepid2_ENABLE_ROL)
TRIBITS_ADD_EXECUTABLE_AND_TEST(
Test_03
SOURCES test_03.cc
ARGS PrintItAll
NUM_MPI_PROCS 1
PASS_REGULAR_EXPRESSION "PASSED"
ADD_DIR_TO_NAME
)
ENDIF()

154 changes: 0 additions & 154 deletions packages/intrepid2/core/test/Shared/MiniTensor/test_03.cc

This file was deleted.

0 comments on commit 39658dc

Please sign in to comment.