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
Branches
Tags
No related merge requests found
......@@ -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)
{
TopExp_Explorer exp0, exp1, exp2, exp3, exp4, exp5;
......@@ -483,7 +467,6 @@ GVertex *OCC_Internals::addVertexToModel(GModel *model, TopoDS_Vertex vertex)
if (gv) return gv;
addShapeToLists(vertex);
buildShapeFromLists(vertex);
// buildLists();
buildGModel(model);
return getOCCVertexByNativePtr (model,vertex);
}
......@@ -494,7 +477,6 @@ GEdge *OCC_Internals::addEdgeToModel(GModel *model, TopoDS_Edge edge)
if (ge) return ge;
addShapeToLists(edge);
buildShapeFromLists(edge);
// buildLists();
buildGModel(model);
return getOCCEdgeByNativePtr(model,edge);
}
......@@ -504,7 +486,6 @@ GFace* OCC_Internals::addFaceToModel(GModel *model, TopoDS_Face face){
if (gf) return gf;
addShapeToLists(face);
buildShapeFromLists(face);
// buildLists();
buildGModel(model);
return getOCCFaceByNativePtr(model,face);
}
......@@ -515,9 +496,6 @@ GRegion* OCC_Internals::addRegionToModel(GModel *model, TopoDS_Solid region){
if (gr) return gr;
addShapeToLists(region);
buildShapeFromLists(region);
//buildLists();
// buildLists();
// TEST
buildGModel(model);
return getOCCRegionByNativePtr(model,region);
}
......
......@@ -31,7 +31,6 @@ class OCC_Internals {
TopoDS_Shape getShape () { return shape; }
void buildLists();
void buildShapeFromLists(TopoDS_Shape _shape);
const TopoDS_Shape *lookupInLists(TopoDS_Shape _shape);
void addShapeToLists(TopoDS_Shape shape);
void healGeometry(double tolerance, bool fixsmalledges,
bool fixspotstripfaces, bool sewfaces,
......
......@@ -46,7 +46,7 @@ class linearSystemCSR : public linearSystem<scalar> {
{
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 *ptr = (INDEX_TYPE*) _ptr->array;
......
......@@ -98,7 +98,7 @@ void linearSystemPETSc<fullMatrix<PetscScalar> >::allocate(int nbRows)
void linearSystemPETScRegisterBindings(binding *b)
{
// FIXME on complex arithmetic this crashes
#if !defined(PETSC_USE_COMPLEX)
//#if !defined(PETSC_USE_COMPLEX)
classBinding *cb;
methodBinding *cm;
cb = b->addClass<linearSystemPETSc<PetscScalar> >("linearSystemPETSc");
......@@ -109,14 +109,19 @@ void linearSystemPETScRegisterBindings(binding *b)
cm->setArgNames(NULL);
cm = cb->addMethod("systemSolve", &linearSystem<fullMatrix<PetscScalar> >::systemSolve);
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->setDescription("A linear system solver, based on PETSc");
cm = cb->setConstructor<linearSystemPETSc<fullMatrix<PetscScalar> >, int>();
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 = cb->addMethod("systemSolve", &linearSystem<fullMatrix<PetscScalar> >::systemSolve);
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.
Please register or to comment