Greetings!

  Well, actually that was my question - how to initialize this matrix,
  i.e.  how  to  set it up for appropriate size? From you message I've
  understood  that probably I have to declare QuadratureHistory not as
  a struct but as a class with appropriate constructor?

Regards,
Slawa

Thursday, June 17, 2010, 18:45, you wrote:


>>    First problem I face is that I cannot explicitly define the size of
>>    the matrix, so I cannot write
>> template <int dim>
>> struct QuadratureHistory
>> {
>>     dealii::SymmetricTensor<2,dim> effective_eigenstrain;
>>     dealii::SymmetricTensor<2,dim> strain;
>>     dealii::FullMatrix<double>     effective_stiffness(6,6);
>> };
>>    it cause a compiler error:

WB> Yes, what you have is the *declaration* of a structure and you can't 
WB> initialize members there like you want to do. You'll have to write a 
WB> constructor in which you can initialize the member variable in a way 
WB> similar to the above.


>>   quadrature_history[i].effective_stiffness(6,6);

WB> All indices in deal.II are zero-based, so if your matrix has size 6x6, then
WB> valid indices are 0...5. That said, from this error...

>> Index 6 is not in [0,0[

WB> ...it seems that you are accessing a matrix that hasn't even be set to size
WB> 6x6 yet.

WB> W.

WB> -------------------------------------------------------------------------
WB> Wolfgang Bangerth                email:            [email protected]
WB>                                  www:
WB> http://www.math.tamu.edu/~bangerth/




-- 
Best regards,                                       17.06.2010
Svyatoslav Gladkov, Kharkov, UKRAINE                22:06

_______________________________________________
dealii mailing list http://poisson.dealii.org/mailman/listinfo/dealii

Reply via email to