Hi, everyone! I ran into a compiler error that feels strange to me. And I use C++ only occasionally.
/home/li/cbrc01.cc:1378:8: error: no match for ‘operator*=’ (operand types are ‘const dealii::TrilinosWrappers::MPI::Vector’ and ‘int’) 1378 | um *= -1; | ~~~^~~~~ /home/li/share/dealii-9.6.0/include/deal.II/lac/trilinos_vector.h:1993:5: note: candidate: ‘dealii::TrilinosWrappers::MPI::Vector& dealii::TrilinosWrappers::MPI::Vector::operator*=(dealii::TrilinosScalar)’ (near match) 1993 | Vector::operator*=(const TrilinosScalar a) | ^~~~~~ /home/li/share/dealii-9.6.0/include/deal.II/lac/trilinos_vector.h:1993:5: note: passing ‘const dealii::TrilinosWrappers::MPI::Vector*’ as ‘this’ argument discards qualifiers make[2]: *** [CMakeFiles/cbrc01.dir/build.make:76: CMakeFiles/cbrc01.dir/cbrc01.cc.o] Error 1 make[1]: *** [CMakeFiles/Makefile2:90: CMakeFiles/cbrc01.dir/all] Error 2 make: *** [Makefile:91: all] Error 2 According to the above error message, the compiler indeed recognized "um" to be a dealii::TrilinosWrappers::MPI::Vector object. It further suggested that it is a "near match" to the defined operator "Vector::operator*=(const TrilinosScalar a)". Furthermore, Step-41 used exactly the same operation in method void ObstacleProblem<dim>::update_solution_and_constraints() in the line contact_force *= -1; I was able to compile and run Step-41 without error. That indicates that my installations of dealii and Trilinos work for the operator *=. Your help is greatly appreciated. Thanks in advance. Best, X. Li -- 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 visit https://groups.google.com/d/msgid/dealii/363073b4-57e0-43a3-bb1e-6038b056bcccn%40googlegroups.com.