Skip to content
Snippets Groups Projects
Commit 3c0c2ee5 authored by Jean-François Remacle's avatar Jean-François Remacle
Browse files

fixed a bug in linearSystemPetSC<fullMatrix<PetscScalar> >

base class was not defined
try it again ...
parent 8f8a7b3e
No related branches found
No related tags found
No related merge requests found
...@@ -52,22 +52,6 @@ void OCC_Internals::buildShapeFromLists(TopoDS_Shape _shape) ...@@ -52,22 +52,6 @@ void OCC_Internals::buildShapeFromLists(TopoDS_Shape _shape)
} }
const TopoDS_Shape *OCC_Internals::lookupInLists(TopoDS_Shape _shape)
{
if (_shape.ShapeType() == TopAbs_VERTEX) {
TopoDS_Vertex vertex = TopoDS::Vertex(_shape);
int i = vmap.FindIndex(vertex);
if( i < 1)return NULL;
else return &vmap(i);
}
else if (_shape.ShapeType() == TopAbs_EDGE) {
TopoDS_Edge edge = TopoDS::Edge(_shape);
int i = emap.FindIndex(edge);
if( i < 1)return 0;
else return &emap(i);
}
}
void OCC_Internals::addShapeToLists(TopoDS_Shape _shape) void OCC_Internals::addShapeToLists(TopoDS_Shape _shape)
{ {
TopExp_Explorer exp0, exp1, exp2, exp3, exp4, exp5; TopExp_Explorer exp0, exp1, exp2, exp3, exp4, exp5;
...@@ -483,7 +467,6 @@ GVertex *OCC_Internals::addVertexToModel(GModel *model, TopoDS_Vertex vertex) ...@@ -483,7 +467,6 @@ GVertex *OCC_Internals::addVertexToModel(GModel *model, TopoDS_Vertex vertex)
if (gv) return gv; if (gv) return gv;
addShapeToLists(vertex); addShapeToLists(vertex);
buildShapeFromLists(vertex); buildShapeFromLists(vertex);
// buildLists();
buildGModel(model); buildGModel(model);
return getOCCVertexByNativePtr (model,vertex); return getOCCVertexByNativePtr (model,vertex);
} }
...@@ -494,7 +477,6 @@ GEdge *OCC_Internals::addEdgeToModel(GModel *model, TopoDS_Edge edge) ...@@ -494,7 +477,6 @@ GEdge *OCC_Internals::addEdgeToModel(GModel *model, TopoDS_Edge edge)
if (ge) return ge; if (ge) return ge;
addShapeToLists(edge); addShapeToLists(edge);
buildShapeFromLists(edge); buildShapeFromLists(edge);
// buildLists();
buildGModel(model); buildGModel(model);
return getOCCEdgeByNativePtr(model,edge); return getOCCEdgeByNativePtr(model,edge);
} }
...@@ -504,7 +486,6 @@ GFace* OCC_Internals::addFaceToModel(GModel *model, TopoDS_Face face){ ...@@ -504,7 +486,6 @@ GFace* OCC_Internals::addFaceToModel(GModel *model, TopoDS_Face face){
if (gf) return gf; if (gf) return gf;
addShapeToLists(face); addShapeToLists(face);
buildShapeFromLists(face); buildShapeFromLists(face);
// buildLists();
buildGModel(model); buildGModel(model);
return getOCCFaceByNativePtr(model,face); return getOCCFaceByNativePtr(model,face);
} }
...@@ -515,9 +496,6 @@ GRegion* OCC_Internals::addRegionToModel(GModel *model, TopoDS_Solid region){ ...@@ -515,9 +496,6 @@ GRegion* OCC_Internals::addRegionToModel(GModel *model, TopoDS_Solid region){
if (gr) return gr; if (gr) return gr;
addShapeToLists(region); addShapeToLists(region);
buildShapeFromLists(region); buildShapeFromLists(region);
//buildLists();
// buildLists();
// TEST
buildGModel(model); buildGModel(model);
return getOCCRegionByNativePtr(model,region); return getOCCRegionByNativePtr(model,region);
} }
......
...@@ -31,7 +31,6 @@ class OCC_Internals { ...@@ -31,7 +31,6 @@ class OCC_Internals {
TopoDS_Shape getShape () { return shape; } TopoDS_Shape getShape () { return shape; }
void buildLists(); void buildLists();
void buildShapeFromLists(TopoDS_Shape _shape); void buildShapeFromLists(TopoDS_Shape _shape);
const TopoDS_Shape *lookupInLists(TopoDS_Shape _shape);
void addShapeToLists(TopoDS_Shape shape); void addShapeToLists(TopoDS_Shape shape);
void healGeometry(double tolerance, bool fixsmalledges, void healGeometry(double tolerance, bool fixsmalledges,
bool fixspotstripfaces, bool sewfaces, bool fixspotstripfaces, bool sewfaces,
......
...@@ -46,7 +46,7 @@ class linearSystemCSR : public linearSystem<scalar> { ...@@ -46,7 +46,7 @@ class linearSystemCSR : public linearSystem<scalar> {
{ {
allocate(0); allocate(0);
} }
virtual void addToMatrix(int il, int ic, const double &val) virtual void addToMatrix(int il, int ic, const scalar &val)
{ {
INDEX_TYPE *jptr = (INDEX_TYPE*) _jptr->array; INDEX_TYPE *jptr = (INDEX_TYPE*) _jptr->array;
INDEX_TYPE *ptr = (INDEX_TYPE*) _ptr->array; INDEX_TYPE *ptr = (INDEX_TYPE*) _ptr->array;
......
...@@ -98,7 +98,7 @@ void linearSystemPETSc<fullMatrix<PetscScalar> >::allocate(int nbRows) ...@@ -98,7 +98,7 @@ void linearSystemPETSc<fullMatrix<PetscScalar> >::allocate(int nbRows)
void linearSystemPETScRegisterBindings(binding *b) void linearSystemPETScRegisterBindings(binding *b)
{ {
// FIXME on complex arithmetic this crashes // FIXME on complex arithmetic this crashes
#if !defined(PETSC_USE_COMPLEX) //#if !defined(PETSC_USE_COMPLEX)
classBinding *cb; classBinding *cb;
methodBinding *cm; methodBinding *cm;
cb = b->addClass<linearSystemPETSc<PetscScalar> >("linearSystemPETSc"); cb = b->addClass<linearSystemPETSc<PetscScalar> >("linearSystemPETSc");
...@@ -109,14 +109,19 @@ void linearSystemPETScRegisterBindings(binding *b) ...@@ -109,14 +109,19 @@ void linearSystemPETScRegisterBindings(binding *b)
cm->setArgNames(NULL); cm->setArgNames(NULL);
cm = cb->addMethod("systemSolve", &linearSystem<fullMatrix<PetscScalar> >::systemSolve); cm = cb->addMethod("systemSolve", &linearSystem<fullMatrix<PetscScalar> >::systemSolve);
cm->setDescription("compute x = A^{-1}b"); cm->setDescription("compute x = A^{-1}b");
cb = b->addClass<linearSystem<fullMatrix<double> > >("linearSystemBlock");
cb->setDescription("A linear system solver with blocks");
cb = b->addClass<linearSystemPETSc<fullMatrix<PetscScalar> > >("linearSystemPETScBlock"); cb = b->addClass<linearSystemPETSc<fullMatrix<PetscScalar> > >("linearSystemPETScBlock");
cb->setDescription("A linear system solver, based on PETSc"); cb->setDescription("A linear system solver, based on PETSc");
cm = cb->setConstructor<linearSystemPETSc<fullMatrix<PetscScalar> >, int>(); cm = cb->setConstructor<linearSystemPETSc<fullMatrix<PetscScalar> >, int>();
cm->setDescription ("A new PETScBlock<PetscScalar> solver (we probably should get rid of the blockSize argument)"); cm->setDescription ("A new PETScBlock<PetscScalar> solver (we probably should get rid of the blockSize argument)");
cb->setParentClass<linearSystem<fullMatrix<PetscScalar> > >();
cm->setArgNames("blockSize", NULL); cm->setArgNames("blockSize", NULL);
cm = cb->addMethod("systemSolve", &linearSystem<fullMatrix<PetscScalar> >::systemSolve); cm = cb->addMethod("systemSolve", &linearSystem<fullMatrix<PetscScalar> >::systemSolve);
cm->setDescription("compute x = A^{-1}b"); cm->setDescription("compute x = A^{-1}b");
#endif // FIXME //#endif // FIXME
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment