Question about "make_periodicity_constraints"

40 views
Skip to first unread message

SY

unread,
Jan 12, 2022, 10:21:19 PM1/12/22
to deal.II User Group
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,
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

Marc Fehling

unread,
Jan 13, 2022, 7:17:20 AM1/13/22
to deal.II User Group
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.

Let us know if that helped!

Marc
Reply all
Reply to author
Forward
0 new messages