Mariia, That's a problem a little more complicated to solve. Basically, we are not instantiating the template for complex<double> and BlockSparseMatrix. If you are OK with recompiling deal.II, you should modify source/numerics/ matrix_tools.inst.in so that all overloads are also compiled for complex numbers. Otherwise, copy https://github.com/dealii/dealii/blob/7439f2b0b4d210d237e8df53f12f47c242cfac3f/source/numerics/matrix_tools.cc#L240-L499 somewhere in your source code.
Best, Daniel Am Mi., 15. Sept. 2021 um 09:10 Uhr schrieb Мария Бронзова < masianic...@gmail.com>: > Dear Daniel, > > Thank you a lot for the hint, it makes perfect sense! I also correctted the* > interpolate_boundary_values* call as follows: > > > > > > > > > > > > > > > > > > > *template <int dim> class DirichletBoundaryValues : public Function<dim, > std::complex<double>> { public: DirichletBoundaryValues() : > Function<dim, std::complex<double>>(1) {} virtual > std::complex<double> value(const Point<dim> &p, const unsigned int > component = 1) const override; }; template <int dim> > std::complex<double> DirichletBoundaryValues<dim>::value(const Point<dim> & > p, const unsigned int /*component*/) const { const > std::complex<double> i = {0,1}; return i; }* > > > > > > > > > > > > > * FEValuesExtractors::Scalar pressures(dim); > std::map<types::global_dof_index, std::complex<double>> boundary_values; > VectorTools::interpolate_boundary_values(dof_handler, 1, > DirichletBoundaryValues<dim>(), boundary_values, > fe.component_mask(pressures)); > MatrixTools::apply_boundary_values(boundary_values, system_matrix, > solution, system_rhs);* > > And now getting the following error: > undefined reference to 'void > dealii::MatrixTools::apply_boundary_values<std::complex<double> > >(std::map<unsigned int, std::complex<double>, std::less<unsigned int>, > std::allocator<std::pair<unsigned int const, std::complex<double> > > > > const&, dealii::BlockSparseMatrix<std::complex<double> >&, > dealii::BlockVector<std::complex<double> >&, > dealii::BlockVector<std::complex<double> >&, bool)' > > I am a bit lost, what it could be connected to. Would appreciate any hints! > > Thank you a lot for your time! > > Kind regards, > Mariia Bronzova > > вторник, 14 сентября 2021 г. в 16:33:44 UTC+2, d.arnd...@gmail.com: > >> Mariia, >> >> You need to make sure that the std::map also uses values of type >> std::complex<double>. The compile error you shared shows that you use >> doubles. >> >> Best, >> Daniel >> >> Am Di., 14. Sept. 2021 um 07:30 Uhr schrieb Мария Бронзова < >> masia...@gmail.com>: >> >>> Hi everyone, >>> >>> I ran into the following difficulty: I have a vector-valued problem with >>> complex numbers as entries for my BlockSparseMatrix system_matrix and >>> BlockVector system_rhs and solution vectors and I am trying to apply >>> Dirichlet boundary conditions, using the >>> MatrixTools::apply_boundary_values(boundary_values, system_matrix, >>> solution, system_rhs) function. >>> >>> The compiler is complaining, indicating the error: no matching function >>> for call to ‘apply_boundary_values(std::map<unsigned int, double>&, >>> dealii::BlockSparseMatrix<std::complex<double> >&, >>> dealii::BlockVector<std::complex<double> >&, >>> dealii::BlockVector<std::complex<double> >&)’. >>> >>> Is it not possible to use the function for complex-values systems? >>> >>> Thank you! >>> >>> Kind regards, >>> Mariia >>> >>> -- >>> 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+un...@googlegroups.com. >>> To view this discussion on the web visit >>> https://groups.google.com/d/msgid/dealii/aa6ad6fa-7404-4617-bff3-3f108d2b6001n%40googlegroups.com >>> <https://groups.google.com/d/msgid/dealii/aa6ad6fa-7404-4617-bff3-3f108d2b6001n%40googlegroups.com?utm_medium=email&utm_source=footer> >>> . >>> >> -- > 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/4a66ce86-5e20-4a5e-a28b-0073d2cfb185n%40googlegroups.com > <https://groups.google.com/d/msgid/dealii/4a66ce86-5e20-4a5e-a28b-0073d2cfb185n%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- 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/CAOYDWbLsbfraH%2Bqdt5zptyEYdG1Dk0OS0xYyVwO7D-8t0HNUeQ%40mail.gmail.com.