Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ROL: fix for Tpetra_DEPRECATED_CODE=OFF #5739

Merged
merged 3 commits into from
Aug 20, 2019
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ namespace ROL {
template<class Real, class Ordinal>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does Ordinal only get used for Comm?

class SingletonTeuchosBatchManager : public TeuchosBatchManager<Real,Ordinal> {
public:
SingletonTeuchosBatchManager(const ROL::Ptr<const Teuchos::Comm<Ordinal> > &comm)
SingletonTeuchosBatchManager(const ROL::Ptr<const Teuchos::Comm<int> > &comm)
: TeuchosBatchManager<Real,Ordinal>(comm) {}

using TeuchosBatchManager<Real,Ordinal>::sumAll;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ namespace ROL {
template<class Real, class Ordinal>
class StdTeuchosBatchManager : public TeuchosBatchManager<Real,Ordinal> {
public:
StdTeuchosBatchManager(const ROL::Ptr<const Teuchos::Comm<Ordinal>> &comm)
StdTeuchosBatchManager(const ROL::Ptr<const Teuchos::Comm<int>> &comm)
: TeuchosBatchManager<Real,Ordinal>(comm) {}

using TeuchosBatchManager<Real,Ordinal>::sumAll;
Expand Down
24 changes: 12 additions & 12 deletions packages/rol/adapters/teuchos/src/sol/ROL_TeuchosBatchManager.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,53 +54,53 @@ namespace ROL {
template<class Real, class Ordinal>
class TeuchosBatchManager : public BatchManager<Real> {
private:
const ROL::Ptr<const Teuchos::Comm<Ordinal> > comm_;
const ROL::Ptr<const Teuchos::Comm<int> > comm_;

public:
TeuchosBatchManager(const ROL::Ptr<const Teuchos::Comm<Ordinal> > &comm)
TeuchosBatchManager(const ROL::Ptr<const Teuchos::Comm<int> > &comm)
: comm_(comm) {}

int batchID(void) {
return Teuchos::rank<Ordinal>(*comm_);
return Teuchos::rank<int>(*comm_);
}

int numBatches(void) {
return Teuchos::size<Ordinal>(*comm_);
return Teuchos::size<int>(*comm_);
}

void reduceAll(Real* input, Real* output, int dim,
const Elementwise::ReductionOp<Real> &r) {
int nB = this->numBatches();
std::vector<Real> receiveBuffer(nB);
Teuchos::gather<Ordinal,Real>(input,1,&receiveBuffer[0],1,0,*comm_);
Teuchos::gather<int,Real>(input,1,&receiveBuffer[0],1,0,*comm_);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ROL devs should start using data() instead of &vec[0] : - )

output[0] = r.initialValue();
for (int i = 0; i < nB; i++) {
r.reduce(receiveBuffer[i],output[0]);
}
Teuchos::broadcast<Ordinal,Real>(*comm_,0,1,output);
Teuchos::broadcast<int,Real>(*comm_,0,1,output);
}

void minAll(Real* input, Real* output, int dim) {
Teuchos::reduceAll<Ordinal,Real>(*comm_,Teuchos::REDUCE_MIN,
Teuchos::reduceAll<int,Real>(*comm_,Teuchos::REDUCE_MIN,
dim, input, output);
}

void maxAll(Real* input, Real* output, int dim) {
Teuchos::reduceAll<Ordinal,Real>(*comm_,Teuchos::REDUCE_MAX,
Teuchos::reduceAll<int,Real>(*comm_,Teuchos::REDUCE_MAX,
dim, input, output);
}

void sumAll(Real* input, Real* output, int dim) {
Teuchos::reduceAll<Ordinal,Real>(*comm_,Teuchos::REDUCE_SUM,
Teuchos::reduceAll<int,Real>(*comm_,Teuchos::REDUCE_SUM,
dim, input, output);
}

void gatherAll(const Real* send, const int ssize, Real *receive, const int rsize) const {
Teuchos::gatherAll<Ordinal,Real>(*comm_,ssize,send,rsize,receive);
Teuchos::gatherAll<int,Real>(*comm_,ssize,send,rsize,receive);
}

void broadcast(Real* input, int cnt, int root) {
Teuchos::broadcast<Ordinal,Real>(*comm_,root,cnt,input);
Teuchos::broadcast<int,Real>(*comm_,root,cnt,input);
}

virtual void sumAll(Vector<Real> &input, Vector<Real> &output) {
Expand All @@ -109,7 +109,7 @@ class TeuchosBatchManager : public BatchManager<Real> {
}

void barrier(void) {
Teuchos::barrier<Ordinal>(*comm_);
Teuchos::barrier<int>(*comm_);
}
};

Expand Down
2 changes: 1 addition & 1 deletion packages/rol/adapters/teuchos/test/sol/test_05.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1116,7 +1116,7 @@ class L2VectorBatchManager : public ROL::TeuchosBatchManager<Real,Ordinal> {
}
}
public:
L2VectorBatchManager(const ROL::Ptr<const Teuchos::Comm<Ordinal> > &comm)
L2VectorBatchManager(const ROL::Ptr<const Teuchos::Comm<int> > &comm)
: ROL::TeuchosBatchManager<Real,Ordinal>(comm) {}
void sumAll(ROL::Vector<Real> &input, ROL::Vector<Real> &output) {
ROL::Ptr<std::vector<Real> > input_ptr;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,13 @@ template<class Real,
class LO=Tpetra::Map<>::local_ordinal_type,
class GO=Tpetra::Map<>::global_ordinal_type,
class Node=Tpetra::Map<>::node_type >
class TpetraTeuchosBatchManager : public TeuchosBatchManager<Real,int> {
class TpetraTeuchosBatchManager : public TeuchosBatchManager<Real,GO> {
typedef Tpetra::MultiVector<Real,LO,GO,Node> Tpetra_Vector;
typedef TpetraMultiVector<Real,LO,GO,Node> OptVector;

public:
TpetraTeuchosBatchManager(const ROL::Ptr<const Teuchos::Comm<int> > &comm)
: TeuchosBatchManager<Real,int>(comm) {}
: TeuchosBatchManager<Real,GO>(comm) {}

void sumAll(Vector<Real> &input, Vector<Real> &output) {
ROL::Ptr<Tpetra_Vector> ivec = dynamic_cast<OptVector&>(input).getVector();
Expand All @@ -74,7 +74,7 @@ class TpetraTeuchosBatchManager : public TeuchosBatchManager<Real,int> {
">>> (TpetraTeuchosBatchManager::sumAll): Inconsistent number of vectors!");

for (size_t i = 0; i < invec; ++i) {
TeuchosBatchManager<Real,int>::sumAll((ivec->getDataNonConst(i)).getRawPtr(),
TeuchosBatchManager<Real,GO>::sumAll((ivec->getDataNonConst(i)).getRawPtr(),
(ovec->getDataNonConst(i)).getRawPtr(),
ilength);
}
Expand Down
5 changes: 2 additions & 3 deletions packages/rol/example/PDE-OPT/0ld/adv-diff-react/data.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -529,9 +529,8 @@ class PoissonData {
// Vector F with Dirichlet conditions G:
// FD = [ F1 ] where F = [ F1 ]
// [ G ] [ F2 ]
ROL::Ptr<Tpetra::Details::DefaultTypes::node_type> node = matA_->getNode();
matA_dirichlet_ = matA_->clone(node);
matM_dirichlet_ = matM_->clone(node);
matA_dirichlet_ = ROL::makePtr<Tpetra::CrsMatrix<>>(*matA_, Teuchos::DataAccess::Copy);
matM_dirichlet_ = ROL::makePtr<Tpetra::CrsMatrix<>>(*matA_, Teuchos::DataAccess::Copy);
vecF_dirichlet_ = ROL::makePtr<Tpetra::MultiVector<>>(matA_->getRangeMap(), 1, true);
Tpetra::deep_copy(*vecF_dirichlet_, *vecF_);
ROL::Ptr<std::vector<std::vector<Intrepid::FieldContainer<int> > > > dirichletSideSets = meshMgr_->getSideSets();
Expand Down
5 changes: 2 additions & 3 deletions packages/rol/example/PDE-OPT/0ld/poisson/data.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -450,9 +450,8 @@ class PoissonData {
// Vector F with Dirichlet conditions G:
// FD = [ F1 ] where F = [ F1 ]
// [ G ] [ F2 ]
ROL::Ptr<Tpetra::Details::DefaultTypes::node_type> node = matA_->getNode();
matA_dirichlet_ = matA_->clone(node);
matM_dirichlet_ = matM_->clone(node);
matA_dirichlet_ = ROL::makePtr<Tpetra::CrsMatrix<>>(*matA_, Teuchos::DataAccess::Copy);
matM_dirichlet_ = ROL::makePtr<Tpetra::CrsMatrix<>>(*matA_, Teuchos::DataAccess::Copy);
vecF_dirichlet_ = ROL::makePtr<Tpetra::MultiVector<>>(matA_->getRangeMap(), 1, true);
Tpetra::deep_copy(*vecF_dirichlet_, *vecF_);
ROL::Ptr<std::vector<std::vector<Intrepid::FieldContainer<int> > > > dirichletSideSets = meshMgr_->getSideSets();
Expand Down
8 changes: 3 additions & 5 deletions packages/rol/example/PDE-OPT/0ld/stefan-boltzmann/data.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -472,9 +472,8 @@ class StefanBoltzmannData {
// Vector F with Dirichlet conditions G:
// FD = [ F1 ] where F = [ F1 ]
// [ G ] [ F2 ]
ROL::Ptr<Tpetra::Details::DefaultTypes::node_type> node = matA_->getNode();
matA_dirichlet_ = matA_->clone(node);
matM_dirichlet_ = matM_->clone(node);
matA_dirichlet_ = ROL::makePtr<Tpetra::CrsMatrix<>>(*matA_, Teuchos::DataAccess::Copy);
matM_dirichlet_ = ROL::makePtr<Tpetra::CrsMatrix<>>(*matA_, Teuchos::DataAccess::Copy);
vecF_dirichlet_ = ROL::makePtr<Tpetra::MultiVector<>>(matA_->getRangeMap(), 1, true);
Tpetra::deep_copy(*vecF_dirichlet_, *vecF_);
ROL::Ptr<std::vector<std::vector<Intrepid::FieldContainer<int> > > > dirichletSideSets = meshMgr_->getSideSets();
Expand Down Expand Up @@ -731,8 +730,7 @@ class StefanBoltzmannData {
}
matA_->fillComplete();

ROL::Ptr<Tpetra::Details::DefaultTypes::node_type> node = matA_->getNode();
matA_dirichlet_ = matA_->clone(node);
matA_dirichlet_ = ROL::makePtr<Tpetra::CrsMatrix<>>(*matA_, Teuchos::DataAccess::Copy);
matA_dirichlet_->resumeFill();
for (int i=0; i<myDirichletDofs_.size(); ++i) {
if (myUniqueMap_->isNodeGlobalElement(myDirichletDofs_[i])) {
Expand Down
6 changes: 2 additions & 4 deletions packages/rol/example/PDE-OPT/0ld/stoch-adv-diff/data.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -602,8 +602,7 @@ class PoissonData {
// Vector F with Dirichlet conditions G:
// FD = [ F1 ] where F = [ F1 ]
// [ G ] [ F2 ]
ROL::Ptr<Tpetra::Details::DefaultTypes::node_type> node = matA_->getNode();
matA_dirichlet_ = matA_->clone(node);
matA_dirichlet_ = ROL::makePtr<Tpetra::CrsMatrix<>>(*matA_, Teuchos::DataAccess::Copy);
matB_dirichlet_ = ROL::makePtr<Tpetra::MultiVector<>>(matA_->getRangeMap(), nz, true);
vecF_dirichlet_ = ROL::makePtr<Tpetra::MultiVector<>>(matA_->getRangeMap(), 1, true);
Tpetra::deep_copy(*matB_dirichlet_, *matB_);
Expand Down Expand Up @@ -805,8 +804,7 @@ class PoissonData {
}
matA_->fillComplete();

ROL::Ptr<Tpetra::Details::DefaultTypes::node_type> node = matA_->getNode();
matA_dirichlet_ = matA_->clone(node);
matA_dirichlet_ = ROL::makePtr<Tpetra::CrsMatrix<>>(*matA_, Teuchos::DataAccess::Copy);
matA_dirichlet_->resumeFill();
for (int i=0; i<myDirichletDofs_.size(); ++i) {
if (myUniqueMap_->isNodeGlobalElement(myDirichletDofs_[i])) {
Expand Down
6 changes: 3 additions & 3 deletions packages/rol/example/PDE-OPT/TOOLS/assembler.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,8 @@ class Assembler {

// Set in SetParallelStructure.
int numCells_;
Teuchos::Array<int> myCellIds_;
Teuchos::Array<int> cellOffsets_;
Teuchos::Array<GO> myCellIds_;
Teuchos::Array<GO> cellOffsets_;
ROL::Ptr<const Tpetra::Map<>> myOverlapStateMap_;
ROL::Ptr<const Tpetra::Map<>> myUniqueStateMap_;
ROL::Ptr<const Tpetra::Map<>> myOverlapControlMap_;
Expand Down Expand Up @@ -663,7 +663,7 @@ class Assembler {
/* Accessor routines. */
/***************************************************************************/
const ROL::Ptr<DofManager<Real>> getDofManager(void) const;
Teuchos::Array<int> getCellIds(void) const;
Teuchos::Array<GO> getCellIds(void) const;
/***************************************************************************/
/* End of accessor routines. */
/***************************************************************************/
Expand Down
28 changes: 18 additions & 10 deletions packages/rol/example/PDE-OPT/TOOLS/assembler_def.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2156,7 +2156,7 @@ const ROL::Ptr<DofManager<Real>> Assembler<Real>::getDofManager(void) const {
}

template<class Real>
Teuchos::Array<int> Assembler<Real>::getCellIds(void) const {
Teuchos::Array<typename Tpetra::Map<>::global_ordinal_type> Assembler<Real>::getCellIds(void) const {
return myCellIds_;
}
/***************************************************************************/
Expand Down Expand Up @@ -2221,7 +2221,7 @@ void Assembler<Real>::setParallelStructure(Teuchos::ParameterList &parlist,
/****************************************************/
// Partition the cells in the mesh. We use a basic quasi-equinumerous partitioning,
// where the remainder, if any, is assigned to the last processor.
Teuchos::Array<int> myGlobalIds;
Teuchos::Array<GO> myGlobalIds;
cellOffsets_.assign(numProcs_, 0);
int totalNumCells = meshMgr_->getNumCells();
int cellsPerProc = totalNumCells / numProcs_;
Expand Down Expand Up @@ -2293,15 +2293,14 @@ void Assembler<Real>::setParallelStructure(Teuchos::ParameterList &parlist,
myGlobalIds.erase( std::unique(myGlobalIds.begin(),myGlobalIds.end()),myGlobalIds.end() );

// Build maps.
myOverlapStateMap_ = ROL::makePtr<Tpetra::Map<>>(
Teuchos::OrdinalTraits<Tpetra::global_size_t>::invalid(),
myGlobalIds, 0, comm_);
myOverlapStateMap_ = ROL::makePtr<Tpetra::Map<>>
(Teuchos::OrdinalTraits<GO>::invalid(), myGlobalIds, GO(0), comm_);
//std::cout << std::endl << myOverlapMap_->getNodeElementList()<<std::endl;
/** One can also use the non-member function:
myOverlapMap_ = Tpetra::createNonContigMap<int,int>(myGlobalIds_, comm_);
to build the overlap map.
**/
myUniqueStateMap_ = Tpetra::createOneToOne<int,int>(myOverlapStateMap_);
myUniqueStateMap_ = Tpetra::createOneToOne(myOverlapStateMap_);
//std::cout << std::endl << myUniqueMap_->getNodeElementList() << std::endl;
myOverlapControlMap_ = myOverlapStateMap_;
myUniqueControlMap_ = myUniqueStateMap_;
Expand All @@ -2315,11 +2314,16 @@ void Assembler<Real>::setParallelStructure(Teuchos::ParameterList &parlist,
/*** Assemble global graph structure. ***/
/****************************************/
matJ1Graph_ = ROL::makePtr<Tpetra::CrsGraph<>>(myUniqueStateMap_, 0);
// Make a GO copy to interface with Tpetra; currently dof manager uses int directly
Teuchos::ArrayRCP<const int> cellDofsArrayRCP = cellDofs.getData();
Teuchos::ArrayRCP<GO> cellDofsGO(cellDofsArrayRCP.size(), GO());
std::copy(cellDofsArrayRCP.getRawPtr(), cellDofsArrayRCP.getRawPtr()+cellDofsArrayRCP.size(),
cellDofsGO.getRawPtr());
Teuchos::ArrayRCP<const GO> cellDofsGOArrayRCP = cellDofsGO.getConst();
for (int i=0; i<numCells_; ++i) {
for (int j=0; j<numLocalDofs; ++j) {
matJ1Graph_->insertGlobalIndices(cellDofs(myCellIds_[i],j),
cellDofsArrayRCP(myCellIds_[i]*numLocalDofs, numLocalDofs));
matJ1Graph_->insertGlobalIndices(GO(cellDofs(myCellIds_[i],j)),
cellDofsGOArrayRCP(myCellIds_[i]*numLocalDofs, numLocalDofs));
}
}
matJ1Graph_->fillComplete();
Expand Down Expand Up @@ -2536,11 +2540,15 @@ void Assembler<Real>::assembleFieldMatrix(ROL::Ptr<Tpetra::CrsMatrix<>> &M,
int numLocalDofs = cellDofs.dimension(1);
int numLocalMatEntries = numLocalDofs * numLocalDofs;
Teuchos::ArrayRCP<const int> cellDofsArrayRCP = cellDofs.getData();
Teuchos::ArrayRCP<GO> cellDofsGO(cellDofsArrayRCP.size(), GO());
std::copy(cellDofsArrayRCP.getRawPtr(), cellDofsArrayRCP.getRawPtr()+cellDofsArrayRCP.size(),
cellDofsGO.getRawPtr());
Teuchos::ArrayRCP<const GO> cellDofsGOArrayRCP = cellDofsGO.getConst();
Teuchos::ArrayRCP<const Real> valArrayRCP = val->getData();
for (int i=0; i<numCells_; ++i) {
for (int j=0; j<numLocalDofs; ++j) {
M->sumIntoGlobalValues(cellDofs(myCellIds_[i],j),
cellDofsArrayRCP(myCellIds_[i] * numLocalDofs, numLocalDofs),
M->sumIntoGlobalValues(GO(cellDofs(myCellIds_[i],j)),
cellDofsGOArrayRCP(myCellIds_[i] * numLocalDofs, numLocalDofs),
valArrayRCP(i*numLocalMatEntries+j*numLocalDofs, numLocalDofs));
}
}
Expand Down
2 changes: 1 addition & 1 deletion packages/rol/example/PDE-OPT/TOOLS/batchmanager.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class PDE_OptVector_BatchManager : public ROL::TeuchosBatchManager<Real,GO> {
typedef PDE_OptVector<Real,LO,GO,Node> OptVector;

public:
PDE_OptVector_BatchManager(const ROL::Ptr<const Teuchos::Comm<GO> > &comm)
PDE_OptVector_BatchManager(const ROL::Ptr<const Teuchos::Comm<int> > &comm)
: ROL::TeuchosBatchManager<Real,GO>(comm) {}

using ROL::TeuchosBatchManager<Real,GO>::sumAll;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,12 @@
template <class Real>
class PotentialFlow {
private:
typedef Tpetra::Map<>::global_ordinal_type GO;

const ROL::Ptr<FE<Real>> feVel_, fePrs_;
const ROL::Ptr<Intrepid::FieldContainer<Real>> cellNodes_;
const ROL::Ptr<Intrepid::FieldContainer<int>> cellDofs_;
const Teuchos::Array<int> cellIds_;
const Teuchos::Array<GO> cellIds_;
const ROL::Ptr<FieldHelper<Real>> fieldHelper_;
Real cx_, cy_, r_;

Expand All @@ -65,7 +67,7 @@ class PotentialFlow {
const ROL::Ptr<FE<Real>> &fePrs,
const ROL::Ptr<Intrepid::FieldContainer<Real>> &cellNodes,
const ROL::Ptr<Intrepid::FieldContainer<int>> &cellDofs,
const Teuchos::Array<int> &cellIds,
const Teuchos::Array<GO> &cellIds,
const ROL::Ptr<FieldHelper<Real>> &fieldHelper,
ROL::ParameterList &parlist)
: feVel_(feVel), fePrs_(fePrs),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,12 @@
template <class Real>
class PotentialFlow {
private:
typedef Tpetra::Map<>::global_ordinal_type GO;

const ROL::Ptr<FE<Real>> feVel_, fePrs_, feThr_;
const ROL::Ptr<Intrepid::FieldContainer<Real>> cellNodes_;
const ROL::Ptr<Intrepid::FieldContainer<int>> cellDofs_;
const Teuchos::Array<int> cellIds_;
const Teuchos::Array<GO> cellIds_;
const ROL::Ptr<FieldHelper<Real>> fieldHelper_;
Real cx_, cy_, r_;

Expand All @@ -66,7 +68,7 @@ class PotentialFlow {
const ROL::Ptr<FE<Real>> &feThr,
const ROL::Ptr<Intrepid::FieldContainer<Real>> &cellNodes,
const ROL::Ptr<Intrepid::FieldContainer<int>> &cellDofs,
const Teuchos::Array<int> &cellIds,
const Teuchos::Array<GO> &cellIds,
const ROL::Ptr<FieldHelper<Real>> &fieldHelper,
ROL::ParameterList &parlist)
: feVel_(feVel), fePrs_(fePrs), feThr_(feThr),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ extern template class Assembler<double>;
template <class Real>
class FractionalOperator : public ROL::LinearOperator<Real> {
private:
typedef Tpetra::Map<>::global_ordinal_type GO;

ROL::Ptr<Tpetra::CrsMatrix<> > Klocal_, Mlocal_;
ROL::Ptr<Tpetra::CrsMatrix<> > Kcylinder_, Mcylinder_;
ROL::Ptr<Tpetra::CrsMatrix<> > KcylinderT_, McylinderT_;
Expand Down Expand Up @@ -117,7 +119,7 @@ class FractionalOperator : public ROL::LinearOperator<Real> {

if ( !transpose_ ) {
size_t numRowEntries(0);
Teuchos::Array<int> indices;
Teuchos::Array<GO> indices;
Teuchos::Array<Real> values;
Teuchos::Array<size_t> col(1), row(1);
for (size_t r = 0; r < Mcylinder_->getGlobalNumRows(); ++r) {
Expand Down Expand Up @@ -159,6 +161,8 @@ class FractionalOperator : public ROL::LinearOperator<Real> {
template <class Real>
class FractionalPreconditioner : public ROL::LinearOperator<Real> {
private:
typedef Tpetra::Map<>::global_ordinal_type GO;

ROL::Ptr<Tpetra::CrsMatrix<> > Klocal_, Mlocal_;
ROL::Ptr<Tpetra::CrsMatrix<> > Kcylinder_, Mcylinder_;
mutable ROL::Ptr<Tpetra::CrsMatrix<> > M_;
Expand Down Expand Up @@ -220,7 +224,7 @@ class FractionalPreconditioner : public ROL::LinearOperator<Real> {

size_t numRowEntries(0);
Real massVal(0), stiffVal(0);
Teuchos::Array<int> indices;
Teuchos::Array<GO> indices;
Teuchos::Array<Real> values;
Teuchos::Array<size_t> row(1);
for (size_t r = 0; r < Mcylinder_->getGlobalNumRows(); ++r) {
Expand Down Expand Up @@ -257,7 +261,7 @@ class FractionalPreconditioner : public ROL::LinearOperator<Real> {

size_t numRowEntries(0);
Real massVal(0), stiffVal(0);
Teuchos::Array<int> indices;
Teuchos::Array<GO> indices;
Teuchos::Array<Real> values;
Teuchos::Array<size_t> row(1);
for (size_t r = 0; r < Mcylinder_->getGlobalNumRows(); ++r) {
Expand Down
2 changes: 1 addition & 1 deletion packages/rol/example/PDE-OPT/obstacle/example_01.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ void computeUpperBound(const ROL::Ptr<Tpetra::MultiVector<> > & ubVec,
const ROL::Ptr<const FE<Real> > & fe,
const ROL::Ptr<Intrepid::FieldContainer<Real> > & cellNodes,
const ROL::Ptr<Intrepid::FieldContainer<int> > & cellDofs,
const Teuchos::Array<int> & cellIds) {
const Teuchos::Array<typename Tpetra::Map<>::global_ordinal_type> & cellIds) {
int c = fe->gradN()->dimension(0);
int f = fe->gradN()->dimension(1);
int d = fe->gradN()->dimension(3);
Expand Down
Loading