diff --git a/Solver/dofManager.h b/Solver/dofManager.h index 6ba920f3da6b664efc3c7d80975704ba1f621bcc..ceb1591db8a67cd2d10f565cb0cf14ffa024d346 100644 --- a/Solver/dofManager.h +++ b/Solver/dofManager.h @@ -139,7 +139,8 @@ class dofManager{ } inline void assemble(MVertex *vR, int iCompR, int iFieldR, MVertex *vC, int iCompC, int iFieldC, - const dataMat &value){ + const dataMat &value) + { assemble(vR->getNum(), Dof::createTypeWithTwoInts(iCompR, iFieldR), vC->getNum(), Dof::createTypeWithTwoInts(iCompC, iFieldC), value); @@ -157,7 +158,8 @@ class dofManager{ assemble(Dof(entR, typeR), value); } inline void assemble(MVertex *vR, int iCompR, int iFieldR, - const dataMat &value){ + const dataMat &value) + { assemble(vR->getNum(), Dof::createTypeWithTwoInts(iCompR, iFieldR), value); } int sizeOfR() const { return unknown.size(); } diff --git a/Solver/elasticitySolver.cpp b/Solver/elasticitySolver.cpp index e47cef39aaa389ffd4330d61e5d57bb7513151b1..bbfed490deadb8806665e741d06b536e24ea8125 100644 --- a/Solver/elasticitySolver.cpp +++ b/Solver/elasticitySolver.cpp @@ -143,7 +143,8 @@ void elasticitySolver::solve() it != nodalDisplacements.end(); ++it){ MVertex *v = pModel->getMeshVertexByTag(it->first.first); pAssembler-> fixVertex(v , it->first.second, _tag, it->second); - printf("-- Fixing node %3d comp %1d to %8.5f\n", it->first.first, it->first.second, it->second); + printf("-- Fixing node %3d comp %1d to %8.5f\n", + it->first.first, it->first.second, it->second); } for (std::map<std::pair<int, int>, double>::iterator it = edgeDisplacements.begin(); @@ -151,7 +152,8 @@ void elasticitySolver::solve() elasticityTerm El(pModel, 1, 1, _tag); El.dirichletNodalBC(it->first.first, 1, it->first.second, _tag, gmshFunction<double>(it->second), *pAssembler); - printf("-- Fixing edge %3d comp %1d to %8.5f\n", it->first.first, it->first.second, it->second); + printf("-- Fixing edge %3d comp %1d to %8.5f\n", + it->first.first, it->first.second, it->second); } for (std::map<std::pair<int, int>, double>::iterator it = faceDisplacements.begin(); @@ -159,7 +161,8 @@ void elasticitySolver::solve() elasticityTerm El(pModel, 1, 1, _tag); El.dirichletNodalBC(it->first.first, 2, it->first.second, _tag, gmshFunction<double>(it->second), *pAssembler); - printf("-- Fixing face %3d comp %1d to %8.5f\n", it->first.first, it->first.second, it->second); + printf("-- Fixing face %3d comp %1d to %8.5f\n", + it->first.first, it->first.second, it->second); } // we number the nodes : when a node is numbered, it cannot be numbered @@ -189,7 +192,8 @@ void elasticitySolver::solve() pAssembler-> assemble(ent[i]->mesh_vertices[0] , 0, _tag, f.x()); pAssembler-> assemble(ent[i]->mesh_vertices[0] , 1, _tag, f.y()); pAssembler-> assemble(ent[i]->mesh_vertices[0] , 2, _tag, f.z()); - printf("-- Force on node %3d(%3d) : %8.5f %8.5f %8.5f\n", ent[i]->mesh_vertices[0]->getNum(), iVertex, f.x(), f.y(), f.z()); + printf("-- Force on node %3d(%3d) : %8.5f %8.5f %8.5f\n", + ent[i]->mesh_vertices[0]->getNum(), iVertex, f.x(), f.y(), f.z()); } } diff --git a/Solver/elasticitySolver.h b/Solver/elasticitySolver.h index 29a8726d220650e2d426c788c8fc35972aa7086d..c4924fa838301c776bfa10ae5a21eb391a4a6522 100644 --- a/Solver/elasticitySolver.h +++ b/Solver/elasticitySolver.h @@ -52,10 +52,12 @@ class elasticitySolver{ void setMesh(const std::string &meshFileName); virtual void solve(); void readInputFile(const std::string &meshFileName); - // PView * buildDisplacementView (const std::string &postFileName); - // PView * buildVonMisesView(const std::string &postFileName); - // std::pair<PView *, PView*> buildErrorEstimateView (const std::string &errorFileName, double, int); - // std::pair<PView *, PView*> buildErrorEstimateView (const std::string &errorFileName, const gmshElasticityData &ref, double, int); + // PView *buildDisplacementView(const std::string &postFileName); + // PView *buildVonMisesView(const std::string &postFileName); + // std::pair<PView *, PView*> buildErrorEstimateView + // (const std::string &errorFileName, double, int); + // std::pair<PView *, PView*> buildErrorEstimateView + // (const std::string &errorFileName, const gmshElasticityData &ref, double, int); }; #endif diff --git a/Solver/elasticityTerm.h b/Solver/elasticityTerm.h index e054c04fa3a2b542b0a0aed0269b53d8928340cb..656aa802170627989a27ab911ad7f25a8a6d7d51 100644 --- a/Solver/elasticityTerm.h +++ b/Solver/elasticityTerm.h @@ -12,7 +12,7 @@ #include "MElement.h" #include "fullMatrix.h" -class elasticityTerm : public femTerm<double,double> { +class elasticityTerm : public femTerm<double, double> { protected: double _E, _nu; int _iField; @@ -32,7 +32,7 @@ class elasticityTerm : public femTerm<double,double> { } public: elasticityTerm(GModel *gm, double E, double nu, int iField) : - femTerm<double,double>(gm), _E(E), _nu(nu), _iField(iField){} + femTerm<double, double>(gm), _E(E), _nu(nu), _iField(iField) {} void setVector(const SVector3 &f) {_volumeForce = f;} void elementMatrix(MElement *e, fullMatrix<double> &m) const; void elementVector(MElement *e, fullVector<double> &m) const; diff --git a/Solver/helmholtzTerm.h b/Solver/helmholtzTerm.h index 73a4dc159a2c843ddfd3531e9c7c2dcd6d8dcaca..6475809459a1f134c6aec4f2bfc4ca1665f26328 100644 --- a/Solver/helmholtzTerm.h +++ b/Solver/helmholtzTerm.h @@ -17,7 +17,7 @@ // \nabla \cdot k \nabla U + a U template<class scalar> -class helmoltzTerm : public femTerm<scalar,scalar> { +class helmoltzTerm : public femTerm<scalar, scalar> { protected: const gmshFunction<scalar> *_k, *_a; const int _iFieldR; @@ -80,9 +80,9 @@ class helmoltzTerm : public femTerm<scalar,scalar> { } for (int j = 0; j < nbNodes; j++){ for (int k = 0; k <= j; k++){ - m(j, k) += (K* (Grads[j][0] * Grads[k][0] + - Grads[j][1] * Grads[k][1] + - Grads[j][2] * Grads[k][2]) + A * sf[j] * sf[k]) * + m(j, k) += (K * (Grads[j][0] * Grads[k][0] + + Grads[j][1] * Grads[k][1] + + Grads[j][2] * Grads[k][2]) + A * sf[j] * sf[k]) * weightDetJ; } } diff --git a/Solver/laplaceTerm.h b/Solver/laplaceTerm.h index e402d28c3cbc1a26c69f48c3533c113e1ad65f85..71b91f32a5ef375f9d42a78eea2ee0e534eefef9 100644 --- a/Solver/laplaceTerm.h +++ b/Solver/laplaceTerm.h @@ -20,11 +20,9 @@ class laplaceTerm : public helmholtzTerm<scalar> { _k = ONE; } laplaceTerm(GModel *gm, int iFieldR, gmshFunction<scalar> *k) : - helmholtzTerm<scalar>(gm, iFieldR, iFieldR, k, 0), ONE(0) - {} + helmholtzTerm<scalar>(gm, iFieldR, iFieldR, k, 0), ONE(0) {} laplaceTerm(GModel *gm, int iFieldR, int iFieldC, gmshFunction<scalar> *k) : - helmholtzTerm<scalar>(gm, iFieldR, iFieldC, k, 0), ONE(0) - {} + helmholtzTerm<scalar>(gm, iFieldR, iFieldC, k, 0), ONE(0) {} virtual ~laplaceTerm() { if(ONE) delete ONE;