From 37c8c2bed7f50c7c383ffbabfecf1b3f3c5697af Mon Sep 17 00:00:00 2001 From: Gaetan Bricteux <gaetan.bricteux@uclouvain.be> Date: Wed, 28 Apr 2010 07:35:36 +0000 Subject: [PATCH] clean up --- Common/DummyBindings.h | 2 +- Common/LuaBindings.cpp | 2 +- Common/LuaBindings.h | 2 +- Plugin/GSHHS.cpp | 2 +- Post/shapeFunctions.h | 2 +- Solver/elasticitySolver.h | 2 +- Solver/function.cpp | 8 +- Solver/function.h | 2 - Solver/functionSpace.h | 240 +++++++++++++++++++------------------- 9 files changed, 129 insertions(+), 133 deletions(-) diff --git a/Common/DummyBindings.h b/Common/DummyBindings.h index b79e7d5e92..736aa0cd92 100644 --- a/Common/DummyBindings.h +++ b/Common/DummyBindings.h @@ -8,7 +8,7 @@ class classBinding { public: - void setDescription(std::string description){}; + void setDescription(std::string description){} template<typename parentType> void setParentClass(){} template <typename cb> diff --git a/Common/LuaBindings.cpp b/Common/LuaBindings.cpp index 170d380f31..5ceb187b06 100644 --- a/Common/LuaBindings.cpp +++ b/Common/LuaBindings.cpp @@ -46,7 +46,7 @@ extern "C" { //trivial class to bind options class gmshOptions { public: - gmshOptions(){}; + gmshOptions(){} void colorSet(std::string category, int index, std::string name, int value) { GmshSetOption(category,name,(unsigned int)(value), index); diff --git a/Common/LuaBindings.h b/Common/LuaBindings.h index b8da1b6078..ef8ba46eb8 100644 --- a/Common/LuaBindings.h +++ b/Common/LuaBindings.h @@ -1026,7 +1026,7 @@ class luaMethodBinding : public methodBinding{ virtual int call (lua_State *L) = 0; luaMethodBinding(const std::string luaname){ _luaname = luaname; } luaMethodBinding(){ _luaname = ""; } - virtual void getArgTypeNames(std::vector<std::string> &names){}; + virtual void getArgTypeNames(std::vector<std::string> &names){} }; template <typename cb> diff --git a/Plugin/GSHHS.cpp b/Plugin/GSHHS.cpp index ec79ea4cc0..2f7be6b6f7 100644 --- a/Plugin/GSHHS.cpp +++ b/Plugin/GSHHS.cpp @@ -234,7 +234,7 @@ public: coordinate_lonlat cll; SPoint3 llradian; public: - coordinate_lonlat_degrees(double r) : cll(r){}; + coordinate_lonlat_degrees(double r) : cll(r){} void to_cartesian(const SPoint3 ll, SPoint3 &xyz) { llradian.setPosition(ll.x() * M_PI / 180, ll.y() * M_PI / 180, 0); diff --git a/Post/shapeFunctions.h b/Post/shapeFunctions.h index f2c5d5cc90..2f8b6ebd36 100644 --- a/Post/shapeFunctions.h +++ b/Post/shapeFunctions.h @@ -706,7 +706,7 @@ public: class prism : public element{ public: - prism(double *x, double *y, double *z) : element(x, y, z) {}; + prism(double *x, double *y, double *z) : element(x, y, z) {} inline int getDimension(){ return 3; } inline int getNumNodes(){ return 6; } void getNode(int num, double &u, double &v, double &w) diff --git a/Solver/elasticitySolver.h b/Solver/elasticitySolver.h index f17418e9ad..fe1d228d5b 100644 --- a/Solver/elasticitySolver.h +++ b/Solver/elasticitySolver.h @@ -30,7 +30,7 @@ struct BoundaryCondition location onWhat; // on vertices or elements int _tag; // tag for the dofManager groupOfElements *g; // support for this BC - BoundaryCondition() : g(0),_tag(0),onWhat(UNDEF) {}; + BoundaryCondition() : g(0),_tag(0),onWhat(UNDEF) {} }; struct dirichletBC : public BoundaryCondition diff --git a/Solver/function.cpp b/Solver/function.cpp index 2d65bc040e..4922c279a5 100644 --- a/Solver/function.cpp +++ b/Solver/function.cpp @@ -13,7 +13,7 @@ function::~function() { } -function::function(int nbCol, bool invalidatedOnElement):_nbCol(nbCol), _invalidatedOnElement(invalidatedOnElement){}; +function::function(int nbCol, bool invalidatedOnElement):_nbCol(nbCol), _invalidatedOnElement(invalidatedOnElement){} void function::addFunctionReplace(functionReplace &fr) { _functionReplaces.push_back(&fr); @@ -211,7 +211,7 @@ function *function::getSolution() { class functionSolutionGradient : public function { static functionSolutionGradient *_instance; - functionSolutionGradient():function(0){};// constructor is private only 1 instance can exists, call get to access the instance + functionSolutionGradient():function(0){} // constructor is private only 1 instance can exists, call get to access the instance public: void call(dataCacheMap *m, fullMatrix<double> &sol) { Msg::Error("a function requires the gradient of the solution but this algorithm does not provide the gradient of the solution"); @@ -230,7 +230,7 @@ function *function::getSolutionGradient() { class functionParametricCoordinates : public function { static functionParametricCoordinates *_instance; - functionParametricCoordinates():function(0, false){};// constructor is private only 1 instance can exists, call get to access the instance + functionParametricCoordinates():function(0, false){} // constructor is private only 1 instance can exists, call get to access the instance public: void call(dataCacheMap *m, fullMatrix<double> &sol) { Msg::Error("a function requires the parametric coordinates but this algorithm does not provide the parametric coordinates"); @@ -249,7 +249,7 @@ function *function::getParametricCoordinates() { class functionNormals : public function { static functionNormals *_instance; - functionNormals():function(0){};// constructor is private only 1 instance can exists, call get to access the instance + functionNormals():function(0){} // constructor is private only 1 instance can exists, call get to access the instance public: void call(dataCacheMap *m, fullMatrix<double> &sol) { Msg::Error("a function requires the normals coordinates but this algorithm does not provide the normals"); diff --git a/Solver/function.h b/Solver/function.h index 91188faf2c..baa9a630ea 100644 --- a/Solver/function.h +++ b/Solver/function.h @@ -107,8 +107,6 @@ public : std::vector<dataCacheDouble*> _dependencies; std::vector<std::pair<dataCacheDouble*, dataCacheDouble*> > _substitutions; - - int _nRowByPoint; function *_function; diff --git a/Solver/functionSpace.h b/Solver/functionSpace.h index 7ca11a6697..e00614e583 100644 --- a/Solver/functionSpace.h +++ b/Solver/functionSpace.h @@ -43,8 +43,8 @@ template<> struct TensorialTraits<SVector3> class FunctionSpaceBase { public: - virtual int getNumKeys(MElement *ele)=0; // if one needs the number of dofs - virtual void getKeys(MElement *ele, std::vector<Dof> &keys)=0; + virtual int getNumKeys(MElement *ele) = 0; // if one needs the number of dofs + virtual void getKeys(MElement *ele, std::vector<Dof> &keys) = 0; }; template<class T> @@ -54,13 +54,15 @@ class FunctionSpace : public FunctionSpaceBase typedef typename TensorialTraits<T>::ValType ValType; typedef typename TensorialTraits<T>::GradType GradType; typedef typename TensorialTraits<T>::HessType HessType; - virtual void f(MElement *ele, double u, double v, double w, std::vector<ValType> &vals)=0; - virtual void gradf(MElement *ele, double u, double v, double w,std::vector<GradType> &grads) =0; - virtual void gradfuvw(MElement *ele, double u, double v, double w,std::vector<GradType> &grads) {}; // should return to pure virtual once all is done. - virtual void hessfuvw(MElement *ele, double u, double v, double -w,std::vector<HessType> &hess)=0; - virtual int getNumKeys(MElement *ele)=0; // if one needs the number of dofs - virtual void getKeys(MElement *ele, std::vector<Dof> &keys)=0; + virtual void f(MElement *ele, double u, double v, double w, std::vector<ValType> &vals) = 0; + virtual void gradf(MElement *ele, double u, double v, double w, + std::vector<GradType> &grads) = 0; + virtual void gradfuvw(MElement *ele, double u, double v, double w, + std::vector<GradType> &grads) {} // should return to pure virtual once all is done. + virtual void hessfuvw(MElement *ele, double u, double v, double w, + std::vector<HessType> &hess) = 0; + virtual int getNumKeys(MElement *ele) = 0; // if one needs the number of dofs + virtual void getKeys(MElement *ele, std::vector<Dof> &keys) = 0; }; class ScalarLagrangeFunctionSpace : public FunctionSpace<double> @@ -80,77 +82,78 @@ class ScalarLagrangeFunctionSpace : public FunctionSpace<double> } public: - ScalarLagrangeFunctionSpace(int i=0):_iField(i) {} - virtual int getId(void) const {return _iField;}; + ScalarLagrangeFunctionSpace(int i = 0) : _iField(i) {} + virtual int getId(void) const {return _iField;} virtual void f(MElement *ele, double u, double v, double w, std::vector<ValType> &vals) { if (ele->getParent()) ele = ele->getParent(); - int ndofs= ele->getNumVertices(); - int curpos=vals.size(); - vals.resize(curpos+ndofs); + int ndofs = ele->getNumVertices(); + int curpos = vals.size(); + vals.resize(curpos + ndofs); ele->getShapeFunctions(u, v, w, &(vals[curpos])); } - // Fonction renvoyant un vecteur contenant le grandient de chaque FF - virtual void gradf(MElement *ele, double u, double v, double w,std::vector<GradType> &grads) + virtual void gradf(MElement *ele, double u, double v, double w, std::vector<GradType> &grads) { if (ele->getParent()) ele = ele->getParent(); - int ndofs= ele->getNumVertices(); - grads.reserve(grads.size()+ndofs); + int ndofs = ele->getNumVertices(); + grads.reserve(grads.size() + ndofs); double gradsuvw[256][3]; ele->getGradShapeFunctions(u, v, w, gradsuvw); double jac[3][3]; double invjac[3][3]; const double detJ = ele->getJacobian(u, v, w, jac); // redondant : on fait cet appel a l'exterieur inv3x3(jac, invjac); - for (int i=0;i<ndofs;++i) + for (int i = 0; i < ndofs; ++i) grads.push_back(GradType( invjac[0][0] * gradsuvw[i][0] + invjac[0][1] * gradsuvw[i][1] + invjac[0][2] * gradsuvw[i][2], invjac[1][0] * gradsuvw[i][0] + invjac[1][1] * gradsuvw[i][1] + invjac[1][2] * gradsuvw[i][2], - invjac[2][0] * gradsuvw[i][0] + invjac[2][1] * gradsuvw[i][1] + invjac[2][2] * gradsuvw[i][2] - )); - }; + invjac[2][0] * gradsuvw[i][0] + invjac[2][1] * gradsuvw[i][1] + invjac[2][2] * gradsuvw[i][2])); + } // Fonction renvoyant un vecteur contenant le hessien [][] de chaque FF dans l'espace ISOPARAMETRIQUE - virtual void hessfuvw(MElement *ele, double u, double v, double w,std::vector<HessType> &hess) + virtual void hessfuvw(MElement *ele, double u, double v, double w, std::vector<HessType> &hess) { - int ndofs= ele->getNumVertices(); // ATTENTION RETOURNE LE NBBRE DE NOEUDS ET PAS LE NBRE DE DDL - hess.reserve(hess.size()+ndofs); // permet de mettre les composantes suivantes à la suite du vecteur + int ndofs = ele->getNumVertices(); // ATTENTION RETOURNE LE NBBRE DE NOEUDS ET PAS LE NBRE DE DDL + hess.reserve(hess.size() + ndofs); // permet de mettre les composantes suivantes à la suite du vecteur double hessuvw[256][3][3]; ele->getHessShapeFunctions(u, v, w, hessuvw); HessType hesst; - for (int i=0;i<ndofs;++i){ - hesst(0,0) = hessuvw[i][0][0] ; hesst(0,1) = hessuvw[i][0][1] ; hesst(0,2) = hessuvw[i][0][2]; - hesst(1,0) = hessuvw[i][1][0] ; hesst(1,1) = hessuvw[i][1][1] ; hesst(1,2) = hessuvw[i][1][2]; - hesst(2,0) = hessuvw[i][2][0] ; hesst(2,1) = hessuvw[i][2][1] ; hesst(2,2) = hessuvw[i][2][2]; + for (int i = 0; i < ndofs; ++i){ + hesst(0,0) = hessuvw[i][0][0]; hesst(0,1) = hessuvw[i][0][1]; hesst(0,2) = hessuvw[i][0][2]; + hesst(1,0) = hessuvw[i][1][0]; hesst(1,1) = hessuvw[i][1][1]; hesst(1,2) = hessuvw[i][1][2]; + hesst(2,0) = hessuvw[i][2][0]; hesst(2,1) = hessuvw[i][2][1]; hesst(2,2) = hessuvw[i][2][2]; hess.push_back(hesst); } - }; + } - virtual void gradfuvw(MElement *ele, double u, double v, double w,std::vector<GradType> &grads) + virtual void gradfuvw(MElement *ele, double u, double v, double w, std::vector<GradType> &grads) { if (ele->getParent()) ele = ele->getParent(); - int ndofs= ele->getNumVertices(); - grads.reserve(grads.size()+ndofs); + int ndofs = ele->getNumVertices(); + grads.reserve(grads.size() + ndofs); double gradsuvw[256][3]; ele->getGradShapeFunctions(u, v, w, gradsuvw); - for (int i=0;i<ndofs;++i) + for (int i = 0; i < ndofs; ++i) grads.push_back(GradType( - gradsuvw[i][0] , - gradsuvw[i][1] , - gradsuvw[i][2] - )); + gradsuvw[i][0], + gradsuvw[i][1], + gradsuvw[i][2])); } - virtual int getNumKeys(MElement *ele) {if (ele->getParent()) ele = ele->getParent();return ele->getNumVertices();} + virtual int getNumKeys(MElement *ele) + { + if (ele->getParent()) ele = ele->getParent(); + return ele->getNumVertices(); + } virtual void getKeys(MElement *ele, std::vector<Dof> &keys) // appends ... { - if (ele->getParent()) ele = ele->getParent(); - int ndofs= ele->getNumVertices(); - keys.reserve(keys.size()+ndofs); - for (int i=0;i<ndofs;++i) - getKeys(ele->getVertex(i),keys); + if (ele->getParent()) ele = ele->getParent(); + int ndofs = ele->getNumVertices(); + keys.reserve(keys.size() + ndofs); + for (int i = 0; i < ndofs; ++i) + getKeys(ele->getVertex(i), keys); } }; @@ -168,20 +171,21 @@ protected : public : template <class T2> ScalarToAnyFunctionSpace(const T2 &SFS, const T& mult, int comp_): ScalarFS(new T2(SFS)) { - multipliers.push_back(mult);comp.push_back(comp_); + multipliers.push_back(mult); comp.push_back(comp_); } template <class T2> ScalarToAnyFunctionSpace(const T2 &SFS, const T& mult1, int comp1_, const T& mult2, int comp2_): ScalarFS(new T2(SFS)) { - multipliers.push_back(mult1);multipliers.push_back(mult2);comp.push_back(comp1_);comp.push_back(comp2_); + multipliers.push_back(mult1); multipliers.push_back(mult2); + comp.push_back(comp1_); comp.push_back(comp2_); } template <class T2> ScalarToAnyFunctionSpace(const T2 &SFS, const T& mult1, int comp1_, - const T& mult2, int comp2_,const T& mult3, int comp3_): ScalarFS(new T2(SFS)) + const T& mult2, int comp2_, const T& mult3, int comp3_): ScalarFS(new T2(SFS)) { - multipliers.push_back(mult1);multipliers.push_back(mult2);multipliers.push_back(mult3); - comp.push_back(comp1_);comp.push_back(comp2_);comp.push_back(comp3_); + multipliers.push_back(mult1); multipliers.push_back(mult2); multipliers.push_back(mult3); + comp.push_back(comp1_); comp.push_back(comp2_); comp.push_back(comp3_); } virtual ~ScalarToAnyFunctionSpace() {delete ScalarFS;} @@ -189,78 +193,78 @@ public : virtual void f(MElement *ele, double u, double v, double w, std::vector<ValType> &vals) { std::vector<double> valsd; - ScalarFS->f(ele,u,v,w,valsd); - int nbdofs=valsd.size(); - int nbcomp=comp.size(); - int curpos=vals.size(); - vals.reserve(curpos+nbcomp*nbdofs); - for (int j=0;j<nbcomp;++j) + ScalarFS->f(ele, u, v, w, valsd); + int nbdofs = valsd.size(); + int nbcomp = comp.size(); + int curpos = vals.size(); + vals.reserve(curpos + nbcomp * nbdofs); + for (int j = 0; j < nbcomp; ++j) { - for (int i=0;i<nbdofs;++i) vals.push_back(multipliers[j]*valsd[i]); + for (int i = 0; i < nbdofs; ++i) + vals.push_back(multipliers[j] * valsd[i]); } } - virtual void gradf(MElement *ele, double u, double v, double w,std::vector<GradType> &grads) + virtual void gradf(MElement *ele, double u, double v, double w, std::vector<GradType> &grads) { std::vector<SVector3> gradsd; - ScalarFS->gradf(ele,u,v,w,gradsd); - int nbdofs=gradsd.size(); - int nbcomp=comp.size(); - int curpos=grads.size(); - grads.reserve(curpos+nbcomp*nbdofs); + ScalarFS->gradf(ele, u, v, w, gradsd); + int nbdofs = gradsd.size(); + int nbcomp = comp.size(); + int curpos = grads.size(); + grads.reserve(curpos + nbcomp * nbdofs); GradType val; - for (int j=0;j<nbcomp;++j) + for (int j = 0; j < nbcomp; ++j) { - for (int i=0;i<nbdofs;++i) + for (int i = 0; i < nbdofs; ++i) { - tensprod(multipliers[j],gradsd[i],val); + tensprod(multipliers[j], gradsd[i], val); grads.push_back(val); } } } - virtual void hessfuvw(MElement *ele, double u, double v, double w,std::vector<HessType> &hess) + virtual void hessfuvw(MElement *ele, double u, double v, double w, std::vector<HessType> &hess) { - ScalarFS->hessfuvw(ele,u,v,w,hess); + ScalarFS->hessfuvw(ele, u, v, w, hess); } - virtual void gradfuvw(MElement *ele, double u, double v, double w,std::vector<GradType> &grads) + virtual void gradfuvw(MElement *ele, double u, double v, double w, std::vector<GradType> &grads) { std::vector<SVector3> gradsd; - ScalarFS->gradfuvw(ele,u,v,w,gradsd); - int nbdofs=gradsd.size(); - int nbcomp=comp.size(); - int curpos=grads.size(); - grads.reserve(curpos+nbcomp*nbdofs); + ScalarFS->gradfuvw(ele, u, v, w, gradsd); + int nbdofs = gradsd.size(); + int nbcomp = comp.size(); + int curpos = grads.size(); + grads.reserve(curpos + nbcomp * nbdofs); GradType val; - for (int j=0;j<nbcomp;++j) + for (int j = 0; j < nbcomp; ++j) { - for (int i=0;i<nbdofs;++i) + for (int i = 0; i < nbdofs; ++i) { - tensprod(multipliers[j],gradsd[i],val); + tensprod(multipliers[j], gradsd[i], val); grads.push_back(val); } } } - virtual int getNumKeys(MElement *ele) {return ScalarFS->getNumKeys(ele)*comp.size();} + virtual int getNumKeys(MElement *ele) {return ScalarFS->getNumKeys(ele) * comp.size();} virtual void getKeys(MElement *ele, std::vector<Dof> &keys) { - - int nk=ScalarFS->getNumKeys(ele); + int nk = ScalarFS->getNumKeys(ele); std::vector<Dof> bufk; bufk.reserve(nk); - ScalarFS->getKeys(ele,bufk); - int nbdofs=bufk.size(); - int nbcomp=comp.size(); - int curpos=keys.size(); - keys.reserve(curpos+nbcomp*nbdofs); - for (int j=0;j<nbcomp;++j) + ScalarFS->getKeys(ele, bufk); + int nbdofs = bufk.size(); + int nbcomp = comp.size(); + int curpos = keys.size(); + keys.reserve(curpos + nbcomp * nbdofs); + for (int j = 0; j < nbcomp; ++j) { - for (int i=0;i<nk;++i) + for (int i = 0; i < nk; ++i) { - int i1,i2; - Dof::getTwoIntsFromType(bufk[i].getType(), i1,i2); - keys.push_back(Dof(bufk[i].getEntity(),Dof::createTypeWithTwoInts(comp[j],i1))); + int i1, i2; + Dof::getTwoIntsFromType(bufk[i].getType(), i1, i2); + keys.push_back(Dof(bufk[i].getEntity(), Dof::createTypeWithTwoInts(comp[j], i1))); } } } @@ -271,24 +275,24 @@ class VectorLagrangeFunctionSpace : public ScalarToAnyFunctionSpace<SVector3> protected: static const SVector3 BasisVectors[3]; public: - enum Along { VECTOR_X=0, VECTOR_Y=1, VECTOR_Z=2 }; + enum Along { VECTOR_X = 0, VECTOR_Y = 1, VECTOR_Z = 2 }; typedef TensorialTraits<SVector3>::ValType ValType; typedef TensorialTraits<SVector3>::GradType GradType; VectorLagrangeFunctionSpace(int id) : ScalarToAnyFunctionSpace<SVector3>::ScalarToAnyFunctionSpace(ScalarLagrangeFunctionSpace(id), - SVector3(1.,0.,0.),VECTOR_X, SVector3(0.,1.,0.),VECTOR_Y,SVector3(0.,0.,1.),VECTOR_Z) + SVector3(1.,0.,0.), VECTOR_X, SVector3(0.,1.,0.), VECTOR_Y, SVector3(0.,0.,1.), VECTOR_Z) {} VectorLagrangeFunctionSpace(int id,Along comp1) : ScalarToAnyFunctionSpace<SVector3>::ScalarToAnyFunctionSpace(ScalarLagrangeFunctionSpace(id), - BasisVectors[comp1],comp1) + BasisVectors[comp1], comp1) {} VectorLagrangeFunctionSpace(int id,Along comp1,Along comp2) : ScalarToAnyFunctionSpace<SVector3>::ScalarToAnyFunctionSpace(ScalarLagrangeFunctionSpace(id), - BasisVectors[comp1],comp1, BasisVectors[comp2],comp2) + BasisVectors[comp1], comp1, BasisVectors[comp2], comp2) {} VectorLagrangeFunctionSpace(int id,Along comp1,Along comp2, Along comp3) : ScalarToAnyFunctionSpace<SVector3>::ScalarToAnyFunctionSpace(ScalarLagrangeFunctionSpace(id), - BasisVectors[comp1],comp1, BasisVectors[comp2],comp2, BasisVectors[comp3],comp3) + BasisVectors[comp1], comp1, BasisVectors[comp2], comp2, BasisVectors[comp3], comp3) {} }; @@ -324,39 +328,39 @@ class CompositeFunctionSpace : public FunctionSpace<T> } ~CompositeFunctionSpace(void) { - for (iterFS it=_spaces.begin(); it!=_spaces.end();++it) + for (iterFS it = _spaces.begin(); it != _spaces.end(); ++it) delete (*it); } - virtual void f(MElement *ele, double u, double v, double w,std::vector<ValType> &vals) + virtual void f(MElement *ele, double u, double v, double w, std::vector<ValType> &vals) { - for (iterFS it=_spaces.begin(); it!=_spaces.end();++it) - (*it)->f(ele,u,v,w,vals); + for (iterFS it = _spaces.begin(); it != _spaces.end(); ++it) + (*it)->f(ele, u, v, w, vals); } - virtual void gradf(MElement *ele, double u, double v, double w,std::vector<GradType> &grads) + virtual void gradf(MElement *ele, double u, double v, double w, std::vector<GradType> &grads) { - for (iterFS it=_spaces.begin(); it!=_spaces.end();++it) - (*it)->gradf(ele,u,v,w,grads); + for (iterFS it = _spaces.begin(); it != _spaces.end(); ++it) + (*it)->gradf(ele, u, v, w, grads); } - virtual void hessfuvw(MElement *ele, double u, double v, double w,std::vector<HessType> &hess) + virtual void hessfuvw(MElement *ele, double u, double v, double w, std::vector<HessType> &hess) { - for (iterFS it=_spaces.begin(); it!=_spaces.end();++it) - (*it)->hessfuvw(ele,u,v,w,hess); + for (iterFS it = _spaces.begin(); it != _spaces.end(); ++it) + (*it)->hessfuvw(ele, u, v, w, hess); } virtual int getNumKeys(MElement *ele) { - int ndofs=0; - for (iterFS it=_spaces.begin(); it!=_spaces.end();++it) - ndofs+=(*it)->getNumKeys(ele); + int ndofs = 0; + for (iterFS it = _spaces.begin(); it != _spaces.end(); ++it) + ndofs += (*it)->getNumKeys(ele); return ndofs; } virtual void getKeys(MElement *ele, std::vector<Dof> &keys) { - for (iterFS it=_spaces.begin(); it!=_spaces.end();++it) - (*it)->getKeys(ele,keys); + for (iterFS it = _spaces.begin(); it != _spaces.end(); ++it) + (*it)->getKeys(ele, keys); } }; @@ -372,8 +376,9 @@ class xFemFunctionSpace : public FunctionSpace<T> simpleFunctionOnElement<double> *_funcEnrichment; public: - virtual void hessfuvw(MElement *ele, double u, double v, double w,std::vector<HessType> &hess){}; - xFemFunctionSpace(FunctionSpace<T>* spacebase,simpleFunctionOnElement<double> *funcEnrichment) : _spacebase(spacebase),_funcEnrichment(funcEnrichment){}; + virtual void hessfuvw(MElement *ele, double u, double v, double w,std::vector<HessType> &hess){} + xFemFunctionSpace(FunctionSpace<T>* spacebase,simpleFunctionOnElement<double> *funcEnrichment) : + _spacebase(spacebase),_funcEnrichment(funcEnrichment){} virtual void f(MElement *ele, double u, double v, double w,std::vector<ValType> &vals); virtual void gradf(MElement *ele, double u, double v, double w,std::vector<GradType> &grads); virtual int getNumKeys(MElement *ele); @@ -381,26 +386,19 @@ class xFemFunctionSpace : public FunctionSpace<T> }; -template<class T,class F> +template<class T, class F> class FilteredFunctionSpace : public FunctionSpace<T> { - public : - typedef typename TensorialTraits<T>::ValType ValType; typedef typename TensorialTraits<T>::GradType GradType; typedef typename TensorialTraits<T>::HessType HessType; protected: - FunctionSpace<T>* _spacebase; - F *_filter; - public: - - virtual void hessfuvw(MElement *ele, double u, double v, double w,std::vector<HessType> &hess){}; - FilteredFunctionSpace<T,F>(FunctionSpace<T>* spacebase,F * filter) : _spacebase(spacebase),_filter(filter) - {}; + virtual void hessfuvw(MElement *ele, double u, double v, double w,std::vector<HessType> &hess){} + FilteredFunctionSpace<T,F>(FunctionSpace<T>* spacebase,F * filter) : _spacebase(spacebase),_filter(filter){} virtual void f(MElement *ele, double u, double v, double w,std::vector<ValType> &vals); virtual void gradf(MElement *ele, double u, double v, double w,std::vector<GradType> &grads); virtual int getNumKeys(MElement *ele); -- GitLab