Skip to content
Snippets Groups Projects
Commit 84a46ff1 authored by Ruth Sabariego's avatar Ruth Sabariego
Browse files

Fix in linearSystemPETSc<scalar>::getData() for compatibility with PETSC_USE_COMPLEX

parent 4ba3f610
Branches
Tags
No related merge requests found
...@@ -263,8 +263,14 @@ std::vector<scalar> linearSystemPETSc<scalar>::getData() ...@@ -263,8 +263,14 @@ std::vector<scalar> linearSystemPETSc<scalar>::getData()
MatInfo info; MatInfo info;
_try(MatGetInfo(_a,MAT_LOCAL,&info)); _try(MatGetInfo(_a,MAT_LOCAL,&info));
std::vector<scalar> data; // Maybe I should reserve or resize (SAM) 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++) for (int i = 0; i < info.nz_allocated; i++)
data.push_back(v[i]); data.push_back(v[i]);
#endif
_try(MatRestoreArray(_a,&v)); _try(MatRestoreArray(_a,&v));
return data; return data;
} }
......
...@@ -3,7 +3,7 @@ Geometry.OCCFixSmallFaces = 1; ...@@ -3,7 +3,7 @@ Geometry.OCCFixSmallFaces = 1;
Merge "tank.brep"; Merge "tank.brep";
n = 2; n = 1;
Transfinite Line {55, 56, 13, 12, 36, 32, 95, 94, 97, 105, Transfinite Line {55, 56, 13, 12, 36, 32, 95, 94, 97, 105,
80, 61, 64, 78, 50, 48} = 5*n; // indep. 80, 61, 64, 78, 50, 48} = 5*n; // indep.
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
// The simplest construction in Gmsh's scripting language is the // The simplest construction in Gmsh's scripting language is the
// `affectation'. The following command defines a new variable `lc': // `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 // 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 // `elementary entity', a `Point'. A Point is defined by a list of
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
int main(int argc, char **argv) int main(int argc, char **argv)
{ {
GmshInitialize(argc, argv); GmshInitialize(argc, argv);
//GmshSetOption("Mesh", "Algorithm", 5); GmshSetOption("Mesh", "Algorithm", 5.);
GModel *m = new GModel(); GModel *m = new GModel();
m->readGEO("../../tutorial/t5.geo"); m->readGEO("../../tutorial/t5.geo");
//GmshMergeFile("../../tutorial/t5.geo"); // will also set the bbox //GmshMergeFile("../../tutorial/t5.geo"); // will also set the bbox
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment