[Trilinos-Users] Teuchos::Array error
Sunghwan Choi
sunghwanchoi91 at gmail.com
Wed Mar 20 05:49:57 MDT 2013
I report the same error before; however, I didn't get the solution thus, I
re-report it
I made simple code like below
#include <iostream>
#include "Teuchos_RCP.hpp"
#include "Teuchos_Array.hpp"
#include "Epetra_CrsMatrix.h"
#include "Epetra_Map.h"
#include "Epetra_SerialComm.h"
using namespace std;
int main (){
Epetra_SerialComm Comm;
Epetra_Map Map(20,0,Comm);
Teuchos::Array< Teuchos::RCP<Epetra_CrsMatrix> > arr ;
for(int i=0;i<10;i++){
Teuchos::RCP <Epetra_CrsMatrix> tmp = Teuchos::rcp(new
Epetra_CrsMatrix(Copy,Map,0));
arr.push_back( tmp );
}
double tmp_scalar = 0.0;
int* tmp_index = new int[1];
tmp_index[0]=1;
arr[0]->InsertGlobalValues(0,1,&tmp_scalar,tmp_index);
cout << " No errors up to here" <<endl;
Epetra_CrsMatrix tmp (*(arr[0])); // This throws error!!
return 0;
}
icpc -debug -c tmp.cpp -I /appl/trilinos/libs/include/
icpc -debug -o exe tmp.o -L /appl/trilinos/libs/lib/ -lepetra -lteuchos -L
/appl/intel/mkl/10.1.0.015/lib/em64t/ -lmkl_intel_lp64 -lmkl_core
-lmkl_sequential
./exe
Then, I got the error messages like below.
No errors up to here
terminate called after throwing an instance of 'int'
Aborted (core dumped)
What is the problem? Please let me know the solution
Sincerely
Sunghwan Choi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://software.sandia.gov/pipermail/trilinos-users/attachments/20130320/98a77ffb/attachment.html
More information about the Trilinos-Users
mailing list