// TrilinosWrappers::internal::VectorReference had its non-const copy
-// operator return a const reference. that was non-intuitive but,
+// operator return a const reference. That was non-intuitive but,
// because of the particular semantics of copying vector reference
-// objects, made no difference. either way, have a check for these
-// semantics
+// objects, made no difference. Either way, we now check these semantics.
#include "../tests.h"
#include <deal.II/base/utilities.h>
TrilinosWrappers::internal::VectorReference b (v(1));
TrilinosWrappers::internal::VectorReference c (v(2));
- // copy VectorReference objects. note that operator= for these
- // objects does not copy the*content* of the reference object, but
- // assigns the value of the vector element referenced on the right
- // to the vector element referenced on the left
+ // Copy the VectorReference objects. Note that operator= for these
+ // objects does not copy the *content* of the reference object, but
+ // rather assigns the value of the vector element referenced on the
+ // right to the vector element referenced on the left.
+ // So the applied operations result in the following actions:
+ // 1. We first assign c to point to where a points (c points to entry 0)
+ // 2. We next assign c to point to where b points (c points to entry 1)
+ // 3. Lastly, we assign b to point to where a points (b points to entry 0)
(c = a) = b;
b = a;
deallog << static_cast<TrilinosScalar>(a) << std::endl; // should point to v(0)
deallog << static_cast<TrilinosScalar>(b) << std::endl; // should point to v(0)
- deallog << static_cast<TrilinosScalar>(c) << std::endl; // should point to v(0)
+ deallog << static_cast<TrilinosScalar>(c) << std::endl; // should point to v(1)
}
int main (int argc,char **argv)
{
- std::ofstream logfile("output");
- deallog.attach(logfile);
- deallog.threshold_double(1.e-10);
-
Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv, testing_max_num_threads());
+ MPILogInitAll log;
-
- try
- {
- {
- test ();
- }
- }
- catch (std::exception &exc)
- {
- std::cerr << std::endl << std::endl
- << "----------------------------------------------------"
- << std::endl;
- std::cerr << "Exception on processing: " << std::endl
- << exc.what() << std::endl
- << "Aborting!" << std::endl
- << "----------------------------------------------------"
- << std::endl;
-
- return 1;
- }
- catch (...)
- {
- std::cerr << std::endl << std::endl
- << "----------------------------------------------------"
- << std::endl;
- std::cerr << "Unknown exception!" << std::endl
- << "Aborting!" << std::endl
- << "----------------------------------------------------"
- << std::endl;
- return 1;
- };
+ test ();
}