diff --git a/Geo/MQuadrangle.h b/Geo/MQuadrangle.h index 76d3afcfafba93c842c52ff771bef7a5f1736bad..cc0daf183f7cfbfd07a5ab1f1cafaab6eb66dec8 100644 --- a/Geo/MQuadrangle.h +++ b/Geo/MQuadrangle.h @@ -20,7 +20,7 @@ * | +---- | --> u * | | * | | - * 0-----------1 + * 0-----------1 * */ class binding; @@ -40,12 +40,12 @@ class MQuadrangle : public MElement { v[3] = _v[3]; } public : - MQuadrangle(MVertex *v0, MVertex *v1, MVertex *v2, MVertex *v3, int num=0, int part=0) + MQuadrangle(MVertex *v0, MVertex *v1, MVertex *v2, MVertex *v3, int num=0, int part=0) : MElement(num, part) { _v[0] = v0; _v[1] = v1; _v[2] = v2; _v[3] = v3; } - MQuadrangle(std::vector<MVertex*> &v, int num=0, int part=0) + MQuadrangle(std::vector<MVertex*> &v, int num=0, int part=0) : MElement(num, part) { for(int i = 0; i < 4; i++) _v[i] = v[i]; @@ -59,12 +59,12 @@ class MQuadrangle : public MElement { virtual MVertex *getVertexMED(int num) { static const int map[4] = {0, 3, 2, 1}; - return getVertex(map[num]); + return getVertex(map[num]); } virtual MVertex *getVertexDIFF(int num) { static const int map[4] = {0, 1, 3, 2}; - return getVertex(map[num]); + return getVertex(map[num]); } virtual int getNumEdges(){ return 4; } virtual MEdge getEdge(int num) @@ -87,7 +87,7 @@ class MQuadrangle : public MElement { } virtual int getNumEdgesRep(){ return 4; } virtual void getEdgeRep(int num, double *x, double *y, double *z, SVector3 *n) - { + { MEdge e(getEdge(num)); _getEdgeRep(e.getVertex(0), e.getVertex(1), x, y, z, n, 0); } @@ -100,7 +100,7 @@ class MQuadrangle : public MElement { virtual MFace getFace(int num){ return MFace(_v[0], _v[1], _v[2], _v[3]); } virtual int getNumFacesRep(){ return 2; } virtual void getFaceRep(int num, double *x, double *y, double *z, SVector3 *n) - { + { static const int f[2][3] = { {0, 1, 2}, {0, 2, 3} }; @@ -122,7 +122,7 @@ class MQuadrangle : public MElement { virtual const char *getStringForINP() const { return "C2D4"; } virtual const polynomialBasis* getFunctionSpace(int o=-1) const; virtual const JacobianBasis* getJacobianFuncSpace(int o=-1) const; - virtual void revert() + virtual void revert() { MVertex *tmp = _v[1]; _v[1] = _v[3]; _v[3] = tmp; } @@ -137,9 +137,9 @@ class MQuadrangle : public MElement { virtual double angleShapeMeasure(); virtual double distoShapeMeasure(); // Computes the minimum inradius of the all the circles tangents to 3 of the 4 -// edges of the quad. If the 4 points of the quad are not planar, we compute +// edges of the quad. If the 4 points of the quad are not planar, we compute // the mean plane due to the least-square criterion. - virtual double getInnerRadius(); + virtual double getInnerRadius(); private: int edges_quad(const int edge, const int vert) const { @@ -165,21 +165,21 @@ class MQuadrangle : public MElement { * 7 5 * | | * | | - * 0-----4-----1 + * 0-----4-----1 * */ class MQuadrangle8 : public MQuadrangle { protected: MVertex *_vs[4]; public : - MQuadrangle8(MVertex *v0, MVertex *v1, MVertex *v2, MVertex *v3, MVertex *v4, - MVertex *v5, MVertex *v6, MVertex *v7, int num=0, int part=0) + MQuadrangle8(MVertex *v0, MVertex *v1, MVertex *v2, MVertex *v3, MVertex *v4, + MVertex *v5, MVertex *v6, MVertex *v7, int num=0, int part=0) : MQuadrangle(v0, v1, v2, v3, num, part) { _vs[0] = v4; _vs[1] = v5; _vs[2] = v6; _vs[3] = v7; for(int i = 0; i < 4; i++) _vs[i]->setPolynomialOrder(2); } - MQuadrangle8(std::vector<MVertex*> &v, int num=0, int part=0) + MQuadrangle8(std::vector<MVertex*> &v, int num=0, int part=0) : MQuadrangle(v, num, part) { for(int i = 0; i < 4; i++) _vs[i] = v[4 + i]; @@ -192,17 +192,17 @@ class MQuadrangle8 : public MQuadrangle { virtual MVertex *getVertexUNV(int num) { static const int map[8] = {0, 4, 1, 5, 2, 6, 3, 7}; - return getVertex(map[num]); + return getVertex(map[num]); } virtual MVertex *getVertexMED(int num) { static const int map[8] = {0, 3, 2, 1, 7, 6, 5, 4}; - return getVertex(map[num]); + return getVertex(map[num]); } virtual MVertex *getVertexDIFF(int num) { static const int map[8] = {0, 1, 3, 2, 4, 7, 5, 6}; - return getVertex(map[num]); + return getVertex(map[num]); } virtual int getNumEdgeVertices() const { return 4; } virtual int getNumEdgesRep(); @@ -230,7 +230,7 @@ class MQuadrangle8 : public MQuadrangle { virtual const char *getStringForBDF() const { return "CQUAD8"; } virtual const char *getStringForDIFF() const { return "ElmB8n2D"; } virtual const char *getStringForINP() const { return "C2D8"; } - virtual void revert() + virtual void revert() { MVertex *tmp; tmp = _v[1]; _v[1] = _v[3]; _v[3] = tmp; @@ -248,21 +248,21 @@ class MQuadrangle8 : public MQuadrangle { * 7 8 5 * | | * | | - * 0-----4-----1 + * 0-----4-----1 * */ class MQuadrangle9 : public MQuadrangle { protected: MVertex *_vs[5]; public : - MQuadrangle9(MVertex *v0, MVertex *v1, MVertex *v2, MVertex *v3, MVertex *v4, - MVertex *v5, MVertex *v6, MVertex *v7, MVertex *v8, int num=0, int part=0) + MQuadrangle9(MVertex *v0, MVertex *v1, MVertex *v2, MVertex *v3, MVertex *v4, + MVertex *v5, MVertex *v6, MVertex *v7, MVertex *v8, int num=0, int part=0) : MQuadrangle(v0, v1, v2, v3, num, part) { _vs[0] = v4; _vs[1] = v5; _vs[2] = v6; _vs[3] = v7; _vs[4] = v8; for(int i = 0; i < 5; i++) _vs[i]->setPolynomialOrder(2); } - MQuadrangle9(std::vector<MVertex*> &v, int num=0, int part=0) + MQuadrangle9(std::vector<MVertex*> &v, int num=0, int part=0) : MQuadrangle(v, num, part) { for(int i = 0; i < 5; i++) _vs[i] = v[4 + i]; @@ -275,7 +275,7 @@ class MQuadrangle9 : public MQuadrangle { virtual MVertex *getVertexDIFF(int num) { static const int map[9] = {0, 2, 8, 6, 1, 5, 7, 3, 4}; - return getVertex(map[num]); + return getVertex(map[num]); } virtual int getNumEdgeVertices() const { return 4; } virtual int getNumFaceVertices() const { return 1; } @@ -283,9 +283,10 @@ class MQuadrangle9 : public MQuadrangle { virtual void getEdgeRep(int num, double *x, double *y, double *z, SVector3 *n); virtual void getEdgeVertices(const int num, std::vector<MVertex*> &v) const { - v.resize(3); +// v.resize(3); MQuadrangle::getEdgeVertices(num, v); - v[2] = _vs[num]; + v.push_back(_vs[num]); +// v[2] = _vs[num]; } virtual int getNumFacesRep(); virtual void getFaceRep(int num, double *x, double *y, double *z, SVector3 *n); @@ -302,7 +303,7 @@ class MQuadrangle9 : public MQuadrangle { virtual int getTypeForMSH() const { return MSH_QUA_9; } virtual const char *getStringForPOS() const { return "SQ2"; } virtual const char *getStringForDIFF() const { return "ElmB9n2D"; } - virtual void revert() + virtual void revert() { MVertex *tmp; tmp = _v[1]; _v[1] = _v[3]; _v[3] = tmp; @@ -312,17 +313,17 @@ class MQuadrangle9 : public MQuadrangle { }; /* - * MQuadrangle + * MQuadrangle * * 3--3+3E-...--4+2E--2 * | | E = order - 1; * | | N = total number of vertices - * 4+3E 3+2E + * 4+3E 3+2E * | | Interior vertex numbers * ... 4+4e to N-1 ... for edge 0 <= i <= 3: 4+i*E to 3+(i+1)*E * | | in volume : 4+4*E to N-1 * 3+4E 4+E - * | | + * | | * | | * 0---4--...---3+E---1 * @@ -333,12 +334,12 @@ class MQuadrangleN : public MQuadrangle { const char _order; public: MQuadrangleN(MVertex *v0, MVertex *v1, MVertex *v2, MVertex *v3, - std::vector<MVertex*> &v, char order, int num=0, int part=0) + std::vector<MVertex*> &v, char order, int num=0, int part=0) : MQuadrangle(v0, v1, v2, v3, num, part), _vs(v), _order(order) { for(unsigned int i = 0; i < _vs.size(); i++) _vs[i]->setPolynomialOrder(_order); } - MQuadrangleN(std::vector<MVertex*> &v, char order, int num=0, int part=0) + MQuadrangleN(std::vector<MVertex*> &v, char order, int num=0, int part=0) : MQuadrangle(v[0], v[1], v[2], v[3], num, part), _order(order) { for(unsigned int i = 4; i < v.size(); i++) _vs.push_back(v[i]); @@ -348,7 +349,7 @@ class MQuadrangleN : public MQuadrangle { virtual int getPolynomialOrder() const { return _order; } virtual int getNumVertices() const {return 4 + _vs.size(); } virtual MVertex *getVertex(int num){ return num < 4 ? _v[num] : _vs[num - 4]; } - virtual int getNumFaceVertices() const + virtual int getNumFaceVertices() const { if(_order > 1 && (int)_vs.size() + 4 == (_order + 1) * (_order + 1)) return (_order - 1) * (_order - 1); @@ -391,7 +392,7 @@ class MQuadrangleN : public MQuadrangle { if(_order==10 && _vs.size()+4==121) return MSH_QUA_121; return 0; } - virtual void revert() + virtual void revert() { MVertex *tmp; tmp = _v[1]; _v[1] = _v[3]; _v[3] = tmp; @@ -401,7 +402,7 @@ class MQuadrangleN : public MQuadrangle { } }; -template <class T> +template <class T> void inline sort2(T &a, T &b){ if(b<a){ T t=b; @@ -410,7 +411,7 @@ void inline sort2(T &a, T &b){ } } -template <class T> +template <class T> void sort4(T *t[3]) { sort2<T*>(t[0],t[1]); diff --git a/Solver/dofManager.h b/Solver/dofManager.h index 25ebc5a379fd73c391995990acdafb4443ce606c..cb0b5fa8d9c8374f346917a6aeccfbcd77a5924d 100644 --- a/Solver/dofManager.h +++ b/Solver/dofManager.h @@ -130,7 +130,7 @@ class dofManager{ //_linearSystems.["A"] = l1; //_linearSystems["B"] = l2; } - inline void fixDof(Dof key, const dataVec &value) + virtual inline void fixDof(Dof key, const dataVec &value) { if(unknown.find(key) != unknown.end()) return; @@ -160,7 +160,7 @@ class dofManager{ { return isFixed(v->getNum(), Dof::createTypeWithTwoInts(iComp, iField)); } - + inline void numberGhostDof (Dof key, int procId) { if (fixed.find(key) != fixed.end()) return; if (constraints.find(key) != constraints.end()) return; @@ -189,7 +189,7 @@ class dofManager{ numberDof(v->getNum(), Dof::createTypeWithTwoInts(iComp, iField)); } - inline void getDofValue(std::vector<Dof> &keys,std::vector<dataVec> &Vals) + virtual inline void getDofValue(std::vector<Dof> &keys,std::vector<dataVec> &Vals) { int ndofs=keys.size(); size_t originalSize = Vals.size(); @@ -197,7 +197,7 @@ class dofManager{ for (int i=0;i<ndofs;++i) getDofValue(keys[i], Vals[originalSize+i]); } - inline void getDofValue(Dof key, dataVec &val) const + virtual inline void getDofValue(Dof key, dataVec &val) const { { typename std::map<Dof, dataVec>::const_iterator it = fixed.find(key); @@ -562,7 +562,7 @@ void dofManager<T>::_parallelFinalize() { nRequest[i] = 0; for (std::map <Dof, int >::iterator it = ghosted.begin(); it != ghosted.end(); it++) nRequest[it->second] ++; - MPI_Alltoall(nRequest,1,MPI_INT,nRequested,1,MPI_INT,MPI_COMM_WORLD); + MPI_Alltoall(nRequest,1,MPI_INT,nRequested,1,MPI_INT,MPI_COMM_WORLD); long int **recv0 = new long int*[Msg::GetCommSize()]; int **recv1 = new int*[Msg::GetCommSize()]; long int **send0 = new long int*[Msg::GetCommSize()]; diff --git a/Solver/linearSystemPETSc.h b/Solver/linearSystemPETSc.h index 18dea17f39cd46fec5658947134b86f6576b23d7..7bca997fb18a46b12896721e91b7eec04d61abf4 100644 --- a/Solver/linearSystemPETSc.h +++ b/Solver/linearSystemPETSc.h @@ -229,6 +229,7 @@ class linearSystemPETSc : public linearSystem<scalar> { virtual void zeroMatrix() {} virtual void zeroRightHandSide() {} virtual int systemSolve() { return 0; } + virtual double normInfRightHandSide() const{return 0;} }; #endif