From db6eb90357858498f88bd38fd9666a644dc42f4a Mon Sep 17 00:00:00 2001 From: Jean-Francois Remacle <jean-francois.remacle@uclouvain.be> Date: Thu, 17 Sep 2009 12:04:28 +0000 Subject: [PATCH] *** empty log message *** --- Geo/GFaceCompound.cpp | 6 +++--- Solver/CMakeLists.txt | 1 + Solver/dofManager.h | 25 +++++++++++++++---------- Solver/elasticityTerm.h | 2 +- Solver/termOfFormulation.h | 4 ++-- 5 files changed, 22 insertions(+), 16 deletions(-) diff --git a/Geo/GFaceCompound.cpp b/Geo/GFaceCompound.cpp index cd21950869..d0387baef3 100644 --- a/Geo/GFaceCompound.cpp +++ b/Geo/GFaceCompound.cpp @@ -329,8 +329,8 @@ void GFaceCompound::parametrize() const //Laplace parametrization //----------------- - //parametrize(ITERU); - //parametrize(ITERV); + parametrize(ITERU); + parametrize(ITERV); //Conformal map parametrization //----------------- @@ -338,7 +338,7 @@ void GFaceCompound::parametrize() const //Distance function //----------------- - compute_distance(); + //compute_distance(); //checkOrientation(); computeNormals(); diff --git a/Solver/CMakeLists.txt b/Solver/CMakeLists.txt index cc7b83f2f4..5fc96966ae 100644 --- a/Solver/CMakeLists.txt +++ b/Solver/CMakeLists.txt @@ -7,6 +7,7 @@ set(SRC linearSystemCSR.cpp linearSystemTAUCS.cpp elasticityTerm.cpp + elasticitySolver.cpp ) append_gmsh_src(Solver "${SRC}") diff --git a/Solver/dofManager.h b/Solver/dofManager.h index f39bf62ed7..f3fda9a186 100644 --- a/Solver/dofManager.h +++ b/Solver/dofManager.h @@ -31,7 +31,7 @@ namespace gsolver { i1 = t % 10000; i2 = t / 10000; } - bool operator < ( const Dof & other){ + bool operator < ( const Dof & other) const{ if (_entity < other._entity)return true; if (_entity > other._entity)return false; if (_type < other._type)return true; @@ -61,19 +61,19 @@ namespace gsolver { std::map<Dof, dataVec> fixed, initial; // numbering of unknown dof blocks - std::map<Dof, long int> unknown; + std::map<Dof, int> unknown; // associatations std::map<Dof, Dof> associatedWith; // linearSystems - std::map<std::string, linearSystem<dataMat>* > _linearSystems; + std::map<const std::string, linearSystem<dataMat>* > _linearSystems; linearSystem<dataMat>* _current; private: public: dofManager(linearSystem<dataMat> *l) : _current(l){ - _linearSystems.push_back(l); + _linearSystems["default"]= l; } inline void fixDof(long int ent, int type, const dataVec & value) { @@ -110,9 +110,9 @@ namespace gsolver { } return dataVec(0.0); } - inline dataVec getVertexValue(MVertex *v, int iComp, int iField) const + inline dataVec getDofValue(MVertex *v, int iComp, int iField) const { - getDofValue(v->getNum(), Dof::createTypeWithTwoInts(iComp,iField )); + return getDofValue(v->getNum(), Dof::createTypeWithTwoInts(iComp,iField )); } inline void assemble(const Dof &R, const Dof &C, const dataMat &value) @@ -139,9 +139,9 @@ namespace gsolver { assemble (Dof(entR,typeR),Dof(entC,typeC), value); } - inline void assembleVertex(MVertex *vR, int iCompR, int iFieldR, - MVertex *vC, int iCompC, int iFieldC, - const dataMat &value){ + inline void assemble(MVertex *vR, int iCompR, int iFieldR, + MVertex *vC, int iCompC, int iFieldC, + const dataMat &value){ assemble (vR->getNum(), Dof::createTypeWithTwoInts(iCompR,iFieldR), vC->getNum(), Dof::createTypeWithTwoInts(iCompC,iFieldC), value); @@ -157,8 +157,13 @@ namespace gsolver { } inline void assemble(int entR, int typeR, const dataMat &value) { - assemble(Dof(entR,typeR)); + assemble(Dof(entR,typeR),value); } + inline void assemble(MVertex *vR, int iCompR, int iFieldR, + const dataMat &value){ + assemble (vR->getNum(), Dof::createTypeWithTwoInts(iCompR,iFieldR), + value); + } int sizeOfR() const { return unknown.size(); } int sizeOfF() const { return fixed.size(); } void systemSolve(){ diff --git a/Solver/elasticityTerm.h b/Solver/elasticityTerm.h index a6a9fbc3f3..015a1b4962 100644 --- a/Solver/elasticityTerm.h +++ b/Solver/elasticityTerm.h @@ -32,7 +32,7 @@ namespace gsolver { Dof::createTypeWithTwoInts(iCompR, _iField)); } public: - elasticityTerm(GModel *gm, double E, double nu, int iField = 1) : + elasticityTerm(GModel *gm, double E, double nu, int iField) : femTerm<double,double>(gm), _E(E), _nu(nu), _iField(iField){} void setVector(const SVector3 &f) {_volumeForce = f;} void elementMatrix(MElement *e, gmshMatrix<double> &m) const; diff --git a/Solver/termOfFormulation.h b/Solver/termOfFormulation.h index 7eaa77d959..2d66e0ed27 100644 --- a/Solver/termOfFormulation.h +++ b/Solver/termOfFormulation.h @@ -86,7 +86,7 @@ namespace gsolver { int dim, int comp, int field, - const gmshFunction<dataVec> &e, + const gmshFunction<dataVec> &fct, dofManager<dataVec,dataMat> &dm) { std::map<int, std::vector<GEntity*> > groups[4]; @@ -128,7 +128,7 @@ namespace gsolver { gmshVector<dataVec> V (nbR); elementVector (e, V); // assembly - for (int j=0;j<nbR;j++)dm.assemble(getLocalDofR(e,j),V[j]); + for (int j=0;j<nbR;j++)dm.assemble(getLocalDofR(e,j),V(j)); } } }; // end of class definition -- GitLab