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

index c8e0946464db6dfa1c0b9e27702ad07c55838daf..df82e50bdf01cccb109b95597128844275d8b399 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.