From 84a46ff101c15f2c4de2a31051203798daa14cef Mon Sep 17 00:00:00 2001 From: Ruth Sabariego <ruth.sabariego@esat.kuleuven.be> Date: Tue, 1 Mar 2011 14:44:31 +0000 Subject: [PATCH] Fix in linearSystemPETSc<scalar>::getData() for compatibility with PETSC_USE_COMPLEX --- Mesh/meshGFace.cpp | 2 +- Solver/linearSystemPETSc.hpp | 6 ++++++ benchmarks/step/tank.geo | 2 +- tutorial/t1.geo | 2 +- utils/api_demos/mainSimple.cpp | 2 +- 5 files changed, 10 insertions(+), 4 deletions(-) diff --git a/Mesh/meshGFace.cpp b/Mesh/meshGFace.cpp index 3047a51c86..c13e515fe9 100644 --- a/Mesh/meshGFace.cpp +++ b/Mesh/meshGFace.cpp @@ -828,7 +828,7 @@ static bool meshGenerator(GFace *gf, int RECUR_ITER, &recoverMapInv); optimizeMeshBDS(gf, *m, 2); refineMeshBDS(gf, *m, CTX::instance()->mesh.refineSteps, false, - &recoverMapInv); + &recoverMapInv); optimizeMeshBDS(gf, *m, 2); } computeMeshSizeFieldAccuracy(gf, *m, gf->meshStatistics.efficiency_index, diff --git a/Solver/linearSystemPETSc.hpp b/Solver/linearSystemPETSc.hpp index 99c0ad0021..73af243fa2 100644 --- a/Solver/linearSystemPETSc.hpp +++ b/Solver/linearSystemPETSc.hpp @@ -263,8 +263,14 @@ std::vector<scalar> linearSystemPETSc<scalar>::getData() MatInfo info; _try(MatGetInfo(_a,MAT_LOCAL,&info)); std::vector<scalar> data; // Maybe I should reserve or resize (SAM) + +#if defined(PETSC_USE_COMPLEX) + for (int i = 0; i < info.nz_allocated; i++) + data.push_back(v[i].real()); +#else for (int i = 0; i < info.nz_allocated; i++) data.push_back(v[i]); +#endif _try(MatRestoreArray(_a,&v)); return data; } diff --git a/benchmarks/step/tank.geo b/benchmarks/step/tank.geo index 513a3baaac..0b74338cc4 100644 --- a/benchmarks/step/tank.geo +++ b/benchmarks/step/tank.geo @@ -3,7 +3,7 @@ Geometry.OCCFixSmallFaces = 1; Merge "tank.brep"; -n = 2; +n = 1; Transfinite Line {55, 56, 13, 12, 36, 32, 95, 94, 97, 105, 80, 61, 64, 78, 50, 48} = 5*n; // indep. diff --git a/tutorial/t1.geo b/tutorial/t1.geo index 4e6ea1526c..e2f947936f 100644 --- a/tutorial/t1.geo +++ b/tutorial/t1.geo @@ -10,7 +10,7 @@ // The simplest construction in Gmsh's scripting language is the // `affectation'. The following command defines a new variable `lc': -lc = 0.009; +lc = 0.04; // This variable can then be used in the definition of Gmsh's simplest // `elementary entity', a `Point'. A Point is defined by a list of diff --git a/utils/api_demos/mainSimple.cpp b/utils/api_demos/mainSimple.cpp index 806daa8b4f..34d02104c4 100644 --- a/utils/api_demos/mainSimple.cpp +++ b/utils/api_demos/mainSimple.cpp @@ -6,7 +6,7 @@ int main(int argc, char **argv) { GmshInitialize(argc, argv); - //GmshSetOption("Mesh", "Algorithm", 5); + GmshSetOption("Mesh", "Algorithm", 5.); GModel *m = new GModel(); m->readGEO("../../tutorial/t5.geo"); //GmshMergeFile("../../tutorial/t5.geo"); // will also set the bbox -- GitLab