### [deal.II] Re: Error calculating shape gradient

Great, it works now. THanks Simon. BR, Ihsan On Wednesday, June 10, 2020 at 12:50:30 PM UTC+2, Simon Sticko wrote: > > Hi, > Yes. Here, you add a number of scalar elements of different degree: > > > for (unsigned int deg=1; deg <= max_fe_degree; ++deg) > > { > > fe_collection.push_back(FE_Q(deg)); > > quadrature_collection.push_back(QGauss(deg+1)); > > face_quadrature_collection.push_back(QGauss(deg+1)); > > } > > which makes sense for a scalar problem, like the Poisson equation. > > But if you solve for displacement in a material the solution has dim > components: > > u = (u_x, u_y, u_z) > > so you want to use a FESystem element with dim components: > > fe_collection.push_back(FESystem(FE_Q(deg), dim)); > > Best, > Simon > > > On Wednesday, June 10, 2020 at 12:03:57 PM UTC+2, A.Z Ihsan wrote: >> >> Hi Simon, >> >> i followed the tutorial step-27 about hp-fem, using the similar >> constructor with dim = 3 >> for (unsigned int deg=1; deg <= max_fe_degree; ++deg) >> { >> fe_collection.push_back(FE_Q(deg)); >> quadrature_collection.push_back(QGauss(deg+1)); >> face_quadrature_collection.push_back(QGauss(deg+1)); >> } >> >> I tried to look into the fe_collection.n_components(), it yields 1. >> is that what you meant? >> >> BR, >> Ihsan >> >> On Wednesday, June 10, 2020 at 9:07:58 AM UTC+2, Simon Sticko wrote: >>> >>> Hi, >>> from the error message you can see that the element you are using only >>> has 1 component. You get an error because you are trying to access >>> component 1, which doesn't exist. Since your element should have dim >>> components, there is likely something wrong with how you create your >>> element. It should probably be similar as in step-8. >>> >>> Best, >>> Simon >>> >>> >>> On Wednesday, June 10, 2020 at 8:29:03 AM UTC+2, A.Z Ihsan wrote: Hi all, i am getting this error while calculating the local cell matrix for my hp fem application dealii::Tensor<1, spacedim> dealii::FEValuesBase> spacedim>::shape_grad_component(unsigned int, unsigned int, unsigned >> int) >> const [with int dim = 3; int spacedim = 3] > > The violated condition was: > > component < fe->n_components() > > Additional information: > > Index 1 is not in the half-open range [0,1). > > Stacktrace: > > --- > > #0 ../build/local: dealii::FEValuesBase<3, >> 3>::shape_grad_component(unsigned int, unsigned int, unsigned int) const > > #1 ../build/local: dealii::SymmetricTensor<2, 3, double> >> LinearElasticity::get_strain<3>(dealii::FEValues<3, 3> const&, unsigned >> int, unsigned int) > > #2 ../build/local: LinearElasticity::HPSolver<3, >> dealii::Vector >> >::assemble_cell_matrix(dealii::TriaActiveIterator> > >> 3>, false> > const&, dealii::FullMatrix&, >> dealii::hp::FEValues<3, >> 3>&) > > #3 ../build/local: >> LinearElasticity::HPSerialSolver<3>::assemble_linear_system(LinearElasticity::HPSerialSolver<3>::LinearSystem&) > > #4 ../build/local: >> LinearElasticity::HPSerialSolver<3>::solve_problem() > > > > The idea is similar to the tutorial step-27, but here i use the symmetric tensor for returning strain. Can someone explain to me what the error is and how to resolve it? BR, Ihsan >>> -- The deal.II project is located at http://www.dealii.org/ For mailing list/forum options, see https://groups.google.com/d/forum/dealii?hl=en --- You received this message because you are subscribed to the Google Groups "deal.II User Group" group. To unsubscribe from this group and stop receiving emails from it, send an email to dealii+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/dealii/ef61e2f6-6275-4d17-b71c-c9f81caa1c99o%40googlegroups.com.

### [deal.II] Re: Error calculating shape gradient

Hi, Yes. Here, you add a number of scalar elements of different degree: > for (unsigned int deg=1; deg <= max_fe_degree; ++deg) > { > fe_collection.push_back(FE_Q(deg)); > quadrature_collection.push_back(QGauss(deg+1)); > face_quadrature_collection.push_back(QGauss(deg+1)); > } which makes sense for a scalar problem, like the Poisson equation. But if you solve for displacement in a material the solution has dim components: u = (u_x, u_y, u_z) so you want to use a FESystem element with dim components: fe_collection.push_back(FESystem(FE_Q(deg), dim)); Best, Simon On Wednesday, June 10, 2020 at 12:03:57 PM UTC+2, A.Z Ihsan wrote: > > Hi Simon, > > i followed the tutorial step-27 about hp-fem, using the similar > constructor with dim = 3 > for (unsigned int deg=1; deg <= max_fe_degree; ++deg) > { > fe_collection.push_back(FE_Q(deg)); > quadrature_collection.push_back(QGauss(deg+1)); > face_quadrature_collection.push_back(QGauss(deg+1)); > } > > I tried to look into the fe_collection.n_components(), it yields 1. > is that what you meant? > > BR, > Ihsan > > On Wednesday, June 10, 2020 at 9:07:58 AM UTC+2, Simon Sticko wrote: >> >> Hi, >> from the error message you can see that the element you are using only >> has 1 component. You get an error because you are trying to access >> component 1, which doesn't exist. Since your element should have dim >> components, there is likely something wrong with how you create your >> element. It should probably be similar as in step-8. >> >> Best, >> Simon >> >> >> On Wednesday, June 10, 2020 at 8:29:03 AM UTC+2, A.Z Ihsan wrote: >>> >>> Hi all, >>> >>> i am getting this error while calculating the local cell matrix for my >>> hp fem application >>> >>> dealii::Tensor<1, spacedim> dealii::FEValuesBase spacedim>::shape_grad_component(unsigned int, unsigned int, unsigned int) > const [with int dim = 3; int spacedim = 3] The violated condition was: component < fe->n_components() Additional information: Index 1 is not in the half-open range [0,1). Stacktrace: --- #0 ../build/local: dealii::FEValuesBase<3, > 3>::shape_grad_component(unsigned int, unsigned int, unsigned int) const #1 ../build/local: dealii::SymmetricTensor<2, 3, double> > LinearElasticity::get_strain<3>(dealii::FEValues<3, 3> const&, unsigned > int, unsigned int) #2 ../build/local: LinearElasticity::HPSolver<3, > dealii::Vector > >::assemble_cell_matrix(dealii::TriaActiveIterator > > 3>, false> > const&, dealii::FullMatrix&, dealii::hp::FEValues<3, > 3>&) #3 ../build/local: > LinearElasticity::HPSerialSolver<3>::assemble_linear_system(LinearElasticity::HPSerialSolver<3>::LinearSystem&) #4 ../build/local: LinearElasticity::HPSerialSolver<3>::solve_problem() >>> The idea is similar to the tutorial step-27, but here i use the >>> symmetric tensor for returning strain. Can someone explain to me what the >>> error is and how to resolve it? >>> >>> BR, >>> Ihsan >>> >> -- The deal.II project is located at http://www.dealii.org/ For mailing list/forum options, see https://groups.google.com/d/forum/dealii?hl=en --- You received this message because you are subscribed to the Google Groups "deal.II User Group" group. To unsubscribe from this group and stop receiving emails from it, send an email to dealii+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/dealii/dac7f402-fb90-4f1c-940d-5450ddd0cf5do%40googlegroups.com.

### [deal.II] Re: Error calculating shape gradient

Hi Simon, i followed the tutorial step-27 about hp-fem, using the similar constructor with dim = 3 for (unsigned int deg=1; deg <= max_fe_degree; ++deg) { fe_collection.push_back(FE_Q(deg)); quadrature_collection.push_back(QGauss(deg+1)); face_quadrature_collection.push_back(QGauss(deg+1)); } I tried to look into the fe_collection.n_components(), it yields 1. is that what you meant? BR, Ihsan On Wednesday, June 10, 2020 at 9:07:58 AM UTC+2, Simon Sticko wrote: > > Hi, > from the error message you can see that the element you are using only has > 1 component. You get an error because you are trying to access component 1, > which doesn't exist. Since your element should have dim components, there > is likely something wrong with how you create your element. It should > probably be similar as in step-8. > > Best, > Simon > > > On Wednesday, June 10, 2020 at 8:29:03 AM UTC+2, A.Z Ihsan wrote: >> >> Hi all, >> >> i am getting this error while calculating the local cell matrix for my hp >> fem application >> >> dealii::Tensor<1, spacedim> dealii::FEValuesBase>>> spacedim>::shape_grad_component(unsigned int, unsigned int, unsigned int) const [with int dim = 3; int spacedim = 3] >>> >>> The violated condition was: >>> >>> component < fe->n_components() >>> >>> Additional information: >>> >>> Index 1 is not in the half-open range [0,1). >>> >>> Stacktrace: >>> >>> --- >>> >>> #0 ../build/local: dealii::FEValuesBase<3, 3>::shape_grad_component(unsigned int, unsigned int, unsigned int) const >>> >>> #1 ../build/local: dealii::SymmetricTensor<2, 3, double> LinearElasticity::get_strain<3>(dealii::FEValues<3, 3> const&, unsigned int, unsigned int) >>> >>> #2 ../build/local: LinearElasticity::HPSolver<3, dealii::Vector >::assemble_cell_matrix(dealii::TriaActiveIterator>>> > 3>, false> > const&, dealii::FullMatrix&, dealii::hp::FEValues<3, 3>&) >>> >>> #3 ../build/local: LinearElasticity::HPSerialSolver<3>::assemble_linear_system(LinearElasticity::HPSerialSolver<3>::LinearSystem&) >>> >>> #4 ../build/local: LinearElasticity::HPSerialSolver<3>::solve_problem() >>> >>> >>> >>> >> The idea is similar to the tutorial step-27, but here i use the symmetric >> tensor for returning strain. Can someone explain to me what the error is >> and how to resolve it? >> >> BR, >> Ihsan >> > -- The deal.II project is located at http://www.dealii.org/ For mailing list/forum options, see https://groups.google.com/d/forum/dealii?hl=en --- You received this message because you are subscribed to the Google Groups "deal.II User Group" group. To unsubscribe from this group and stop receiving emails from it, send an email to dealii+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/dealii/a53a7d49-9216-4423-ae1b-efde89aa8caeo%40googlegroups.com.

### [deal.II] Re: Error calculating shape gradient

Hi, from the error message you can see that the element you are using only has 1 component. You get an error because you are trying to access component 1, which doesn't exist. Since your element should have dim components, there is likely something wrong with how you create your element. It should probably be similar as in step-8. Best, Simon On Wednesday, June 10, 2020 at 8:29:03 AM UTC+2, A.Z Ihsan wrote: > > Hi all, > > i am getting this error while calculating the local cell matrix for my hp > fem application > > dealii::Tensor<1, spacedim> dealii::FEValuesBase>> spacedim>::shape_grad_component(unsigned int, unsigned int, unsigned int) >>> const [with int dim = 3; int spacedim = 3] >> >> The violated condition was: >> >> component < fe->n_components() >> >> Additional information: >> >> Index 1 is not in the half-open range [0,1). >> >> Stacktrace: >> >> --- >> >> #0 ../build/local: dealii::FEValuesBase<3, >>> 3>::shape_grad_component(unsigned int, unsigned int, unsigned int) const >> >> #1 ../build/local: dealii::SymmetricTensor<2, 3, double> >>> LinearElasticity::get_strain<3>(dealii::FEValues<3, 3> const&, unsigned >>> int, unsigned int) >> >> #2 ../build/local: LinearElasticity::HPSolver<3, dealii::Vector >>> >::assemble_cell_matrix(dealii::TriaActiveIterator>> > >>> 3>, false> > const&, dealii::FullMatrix&, dealii::hp::FEValues<3, >>> 3>&) >> >> #3 ../build/local: >>> LinearElasticity::HPSerialSolver<3>::assemble_linear_system(LinearElasticity::HPSerialSolver<3>::LinearSystem&) >> >> #4 ../build/local: LinearElasticity::HPSerialSolver<3>::solve_problem() >> >> >> >> > The idea is similar to the tutorial step-27, but here i use the symmetric > tensor for returning strain. Can someone explain to me what the error is > and how to resolve it? > > BR, > Ihsan > -- The deal.II project is located at http://www.dealii.org/ For mailing list/forum options, see https://groups.google.com/d/forum/dealii?hl=en --- You received this message because you are subscribed to the Google Groups "deal.II User Group" group. To unsubscribe from this group and stop receiving emails from it, send an email to dealii+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/dealii/9e6af2f7-695c-4a4f-bcd6-17c9a4f008cao%40googlegroups.com.