]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Fix compiling with PETSc with complex scalar type 15856/head
authorDaniel Arndt <arndtd@ornl.gov>
Mon, 7 Aug 2023 12:54:15 +0000 (08:54 -0400)
committerDaniel Arndt <arndtd@ornl.gov>
Tue, 8 Aug 2023 13:10:18 +0000 (09:10 -0400)
source/lac/petsc_vector_base.cc

index b39b919b347143df11d2b8e032601fb7940e7e81..1c4b3ab9671b03c2d1b11c375f06b8ec36619cfe 100644 (file)
@@ -277,8 +277,8 @@ namespace PETScWrappers
         // numbers back as integers later on, we get the same thing.
         for (PetscInt i = 0; i < end_index - ghost_start_index; i++)
           {
-            Assert(static_cast<PetscInt>(static_cast<PetscScalar>(
-                     ghost_start_index + i)) == (ghost_start_index + i),
+            Assert(static_cast<PetscInt>(std::real(static_cast<PetscScalar>(
+                     ghost_start_index + i))) == (ghost_start_index + i),
                    ExcInternalError());
             array[i] = ghost_start_index + i;
           }

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.