Greetz!
I have a following problem. I would like to extend a bit tutorial
18 to solve inhomogeneous elasticity problems. Thus I have to hold
in quadrature points also a stiffness tensor which is represented
in Voigt form as:
FullMatrix<double> effective_stiffness(6,6)
I define a structure:
template <int dim>
struct QuadratureHistory
{
dealii::SymmetricTensor<2,dim> effective_eigenstrain;
dealii::SymmetricTensor<2,dim> strain;
dealii::FullMatrix<double> effective_stiffness;
};
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:
error: expected identifier before numeric constant
error: expected `,` or `...` before numeric constant
OK, I leave it in the first mentioned form and try to initialize the
matrix later, in the setup_cell_history() method. After doing
everything the same as in tutorial I add one more line:
for (unsigned int i=0; i<quadrature_history.size() ; i++)
quadrature_history[i].effective_stiffness(6,6);
where
std::vector<QuadratureHistory<dim> > quadrature_history;
In this case program compiles and runs in the optimized mode but
apparently something is wrong with that because I get segmentation
faults. If I run it in the debug mode I get the following error
message exactly in this place of the code:
--------------------------------------------------------
An error occurred in line <2340> of file
</home/slawa/deal.II/base/include/base/table.h> in function
T& dealii::Table<2, T>::operator()(unsigned int, unsigned int) [with T =
double]
The violated condition was:
i < this->table_size[0]
The name and call sequence of the exception was:
ExcIndexRange (i, 0, this->table_size[0])
Additional Information:
Index 6 is not in [0,0[
Stacktrace:
-----------
#0 ./penmp: dealii::Table<2, double>::operator()(unsigned int, unsigned int)
#1 ./penmp: ElasticProblem<3>::setup_cell_history()
#2 ./penmp: ElasticProblem<3>::initialize()
#3 ./penmp: ElasticProblem<3>::ElasticProblem(Elasticity&, double, unsigned
int)
#4 ./penmp:
ElasticProblemOptimizedQuad<3>::ElasticProblemOptimizedQuad(Elasticity&,
double, unsigned int)
#5 ./penmp: main
--------------------------------------------------------
Could somebody explain me how I should correctly initialize my structures to
avoid error message?
Regards,
Slawa_______________________________________________
dealii mailing list http://poisson.dealii.org/mailman/listinfo/dealii