[Trilinos-Users] Problem extracting element from Epetra_FEVector

mlx82 mlx82 at fastwebnet.it
Fri Oct 31 05:37:20 MDT 2008


Good evening,

I have a problem with EpetraFEVector. I initialize two vectors with this 
syntax:

Xold = new Epetra_FEVector(*mapX);
X    = new Epetra_FEVector(*Xold);

Now, after some computation, I want to extract one-by-one each element 
from X. Notice that I am working on a single process in this code, so I 
have only one vector inside the "multivector".

The command which I use is this (here I use a cout because it is a test):

for (int i=0 ; i < Xdof ; ++i)
        cout << i << "  " << (*(X[0])[i]) << " " << endl;

It works only for i = 0. Then it gives me a segmentation fault.

Can you give me the correct syntax to extract all the element one-by-one?

Thank you for any help.
Best regards,

   Cristiano Malossi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://software.sandia.gov/mailman/private/trilinos-users/attachments/20081031/9aca42d3/attachment-0001.html 


More information about the Trilinos-Users mailing list