I get a seg fault when I try to copy values of vector1 to vector 2;

protected:
std::vector< double > DoubleVector;
std::vector< DoubleVector > vector1
std::vector< DoubleVector > vector 2;

vector1.resize( 5);
int dim =12;
std::vector <DoubleVector >::iterator it;
for( it= vector1 .begin(); it!= vector2.end(); ++it)
{

DoubleVector &oa= *it;
oa.resize( dim );
}

vector2.resize( 5);
int dim =12;
std::vector <DoubleVector >::iterator it;
for( it= vector2 .begin(); it!= vector2.end(); ++it)
{

DoubleVector &oa= *it;
oa.resize( dim );
}

Now, I copy values for vector1 and vector 2.
It works.
then I do vector2. clear();

Then
for( int i =0; i< vector1.size(); i++)
{
for( int j=0; j< vectpr1[i].size(); j++)
{
vector2[i][j]= vector1[i][j];
}
}

I get segmentation fault ;
Thanks.