Hello there! There are many tests that demonstrate how to make periodicity constraints with scalar values finite elements.
For example, have a look at tests/bits/periodicity_01.cc <https://github.com/dealii/dealii/blob/master/tests/bits/periodicity_01.cc>. Let us know if that helped! Marc On Thursday, January 13, 2022 at 4:21:19 AM UTC+1 SY wrote: > Hi, > > I am trying to implement periodic boundary conditions and looking at the > tutorial 45 (https://www.dealii.org/current/doxygen/deal.II/step_45.html > ). > > It seems that > > DoFTools::make_periodicity_constraints<dim, dim>(periodicity_vector, > constraints, > fe.component_mask > <https://www.dealii.org/current/doxygen/deal.II/classFiniteElement.html#a4409f54175f279ac24cc982cfcfcbd2f> > ( > velocities), > first_vector_components); > > works for vector-valued functions/FE. What is the correct way I should do > for a scalar-valued case? I tried to do the same for the Laplace equation, > and I got a runtime error with message: > > *Error: the finite element does not have enough components to define > rotated periodic boundaries.* > > If I drop the last two arguments, I got a runtime error with message: > > *An error occurred in function* > > * void dealii::DoFTools::make_periodicity_constraints(const > FaceIterator &, const typename identity<FaceIterator>::type &, > dealii::ConstraintMatrix &, const dealii::ComponentMask &, const bool, > const bool, const bool, const FullMatrix<double> &, const > std::vector<unsigned int> &) [FaceIterator = > dealii::TriaIterator<dealii::DoFAccessor<2, dealii::DoFHandler<3, 3>, > false> >]* > > *The violated condition was: * > > * matrix.m() == 0 || (first_vector_components.empty() && matrix.m() == > n_dofs_per_face) || (!first_vector_components.empty() && matrix.m() == > (int)spacedim)* > > *Additional information: * > > * The matrix must have either size 0 or spacedim (if > first_vector_components is nonempty) or the size must be equal to the # of > DoFs on the face (if first_vector_components is empty).* > > I really appreciate any suggestion on this. > > Best wishes > -- 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 [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/dealii/83ea1921-cd94-49ea-9ddc-1206c60291cfn%40googlegroups.com.
