Skip to content
Snippets Groups Projects
Commit 7815bd77 authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

fix warnings

parent 2beb51c3
No related branches found
No related tags found
No related merge requests found
......@@ -12,7 +12,7 @@ static void fixEdgeToValue (GEdge *ed,
0, 1, value);
myAssembler.fixVertex(ed->getEndVertex()->mesh_vertices[0],
0, 1, value);
for (int i = 0 ; i < ed->mesh_vertices.size(); i++){
for (unsigned int i = 0 ; i < ed->mesh_vertices.size(); i++){
myAssembler.fixVertex(ed->mesh_vertices[i],0, 1, value);
}
}
......@@ -20,7 +20,7 @@ static void fixEdgeToValue (GEdge *ed,
static void fixEdgeToValueX (GEdge *ed,
gmshAssembler &myAssembler)
{
for (int i = 0 ; i < ed->lines.size(); i++){
for (unsigned int i = 0 ; i < ed->lines.size(); i++){
myAssembler.fixVertex(ed->lines[i]->getVertex(0), 0, 1, ed->lines[i]->getVertex(0)->x());
myAssembler.fixVertex(ed->lines[i]->getVertex(1), 0, 1, ed->lines[i]->getVertex(1)->x());
}
......@@ -29,7 +29,7 @@ static void fixEdgeToValueX (GEdge *ed,
static void fixEdgeToValueY (GEdge *ed,
gmshAssembler &myAssembler)
{
for (int i = 0 ; i < ed->lines.size(); i++){
for (unsigned int i = 0 ; i < ed->lines.size(); i++){
myAssembler.fixVertex(ed->lines[i]->getVertex(0), 0, 1, ed->lines[i]->getVertex(0)->y());
myAssembler.fixVertex(ed->lines[i]->getVertex(1), 0, 1, ed->lines[i]->getVertex(1)->y());
}
......@@ -74,7 +74,7 @@ GFaceCompound::GFaceCompound(GModel *m, int tag, std::list<GFace*> &compound,
std::list<GEdge*> &V1) :
GFace(m,tag),_compound(compound),_U0(U0),_U1(U1),_V0(V0),_V1(V1), oct(0)
{
printf("%d %d %d %d \n",_U0.size(),_U1.size(),_V0.size(),_V1.size());
//printf("%d %d %d %d \n",_U0.size(),_U1.size(),_V0.size(),_V1.size());
getBoundingEdges();
}
......@@ -130,7 +130,7 @@ void GFaceCompound::parametrize (bool _isU) const
std::list<GFace*> :: const_iterator it = _compound.begin();
for ( ; it != _compound.end() ; ++it){
for ( int i=0;i<(*it)->triangles.size() ; ++i){
for (unsigned int i = 0; i < (*it)->triangles.size(); ++i){
MTriangle *t = (*it)->triangles[i];
myAssembler.numberVertex(t->getVertex(0),0, 1);
myAssembler.numberVertex(t->getVertex(1),0, 1);
......@@ -148,7 +148,7 @@ void GFaceCompound::parametrize (bool _isU) const
it = _compound.begin();
for ( ; it != _compound.end() ; ++it){
for ( int i=0;i<(*it)->triangles.size() ; ++i){
for (unsigned int i = 0; i < (*it)->triangles.size(); ++i){
MTriangle *t = (*it)->triangles[i];
double uu[3], vv[3];
for (int j = 0; j < 3; j++){
......@@ -234,9 +234,7 @@ static int GFaceCompoundInEle(void *a, double*c)
R[0] = (c[0] - p0.x());
R[1] = (c[1] - p0.y());
sys2x2(M,R,X);
if (X[0] > -eps &&
X[1] > -eps &&
1.-X[0]-X[1] > -eps){
if (X[0] > -eps && X[1] > -eps && 1. - X[0] - X[1] > -eps){
return 1;
}
return 0;
......@@ -254,7 +252,7 @@ void GFaceCompound::getTriangle (double u, double v,
*t = tt->t;
double M[2][2],X[2],R[2];
const double eps = 1.e-6;
// const double eps = 1.e-6;
const SPoint2 p0 = tt->p1;
const SPoint2 p1 = tt->p2;
const SPoint2 p2 = tt->p3;
......@@ -310,7 +308,7 @@ void GFaceCompound::buildOct() const
int count = 0;
std::list<GFace*> :: const_iterator it = _compound.begin();
for ( ; it != _compound.end() ; ++it){
for ( int i=0;i<(*it)->triangles.size() ; ++i){
for (unsigned int i = 0; i < (*it)->triangles.size(); ++i){
MTriangle *t = (*it)->triangles[i];
for (int j=0;j<3;j++){
std::map<MVertex*,SPoint2>::const_iterator itj =
......@@ -344,7 +342,7 @@ void GFaceCompound::buildOct() const
fprintf(xyzv,"View \"\"{\n");
for ( ; it != _compound.end() ; ++it){
for ( int i=0;i<(*it)->triangles.size() ; ++i){
for (unsigned int i = 0; i < (*it)->triangles.size(); ++i){
MTriangle *t = (*it)->triangles[i];
std::map<MVertex*,SPoint2>::const_iterator it0 =
coordinates.find(t->getVertex(0));
......
......@@ -937,8 +937,6 @@ void getFaceVertices(GRegion *gr, MElement *ele,
face.getVertex(2),
hoEdgeNodes,nPts+1);
double X(0),Y(0),Z(0);
for (int k=start;k<points.size1();k++) {
double t1 = points(k,0);
......@@ -1612,8 +1610,8 @@ void localHarmonicMapping(GModel *gm,
myAssembler.fixVertex ( n2 , 0 , 0 , -1.0);
myAssembler.fixVertex ( n3 , 0 , 0 , 1.0);
myAssembler.fixVertex ( n4 , 0 , 0 , 1.0);
for (int i=0;i<e1.size() ; i++) myAssembler.fixVertex ( e1[i] , 0 , 0, -1.0);
for (int i=0;i<e3.size() ; i++) myAssembler.fixVertex ( e3[i] , 0 , 0, 1.0);
for (unsigned int i = 0; i < e1.size(); i++) myAssembler.fixVertex(e1[i], 0, 0, -1.0);
for (unsigned int i = 0; i < e3.size(); i++) myAssembler.fixVertex(e3[i], 0, 0, 1.0);
Laplace.addToMatrix(myAssembler,t1);
Laplace.addToMatrix(myAssembler,t2);
lsys->systemSolve();
......@@ -1626,8 +1624,8 @@ void localHarmonicMapping(GModel *gm,
myAssembler1.fixVertex ( n3 , 0 , 1 , -1.0);
myAssembler1.fixVertex ( n4 , 0 , 1 , 1.0);
myAssembler1.fixVertex ( n1 , 0 , 1 , 1.0);
for (int i=0;i<e2.size() ; i++) myAssembler1.fixVertex ( e2[i] , 0 , 1, -1.0);
for (int i=0;i<e4.size() ; i++) myAssembler1.fixVertex ( e4[i] , 0 , 1, 1.0);
for (unsigned int i = 0; i < e2.size(); i++) myAssembler1.fixVertex(e2[i], 0, 1, -1.0);
for (unsigned int i = 0; i < e4.size(); i++) myAssembler1.fixVertex(e4[i], 0, 1, 1.0);
Laplace1.addToMatrix(myAssembler1,t1);
Laplace1.addToMatrix(myAssembler1,t2);
lsys1->systemSolve();
......@@ -1638,7 +1636,7 @@ void localHarmonicMapping(GModel *gm,
// this can be done by evaluating the
for (int i=0;i<e.size() ; i++){
for (unsigned int i = 0; i < e.size(); i++){
MVertex *v = e[i];
const double U = myAssembler.getDofValue (v, 0 ,0);
const double V = myAssembler1.getDofValue (v, 0 ,1);
......@@ -1660,7 +1658,7 @@ void getParametricCoordnates ( GFace *gf,
std::vector<MVertex*> &e,
std::vector<SPoint2> &param){
param.clear();
for (int i=0;i<e.size();i++){
for (unsigned int i = 0; i < e.size(); i++){
double U,V;
parametricCoordinates(e[i] , gf, U, V);
param.push_back(SPoint2(U,V));
......
......@@ -14,7 +14,7 @@ void getDistordedElements ( const std::vector<MElement*> & v,
double &minD){
d.clear();
minD = 1;
for (int i=0;i<v.size() ; i++){
for (unsigned int i = 0; i < v.size(); i++){
const double disto = v[i]->distoShapeMeasure();
if (disto < threshold)
d.push_back(v[i]);
......@@ -26,7 +26,7 @@ void addOneLayer ( const std::vector<MElement*> & v,
std::vector<MElement*> & d ,
std::vector<MElement*> & layer ){
std::set<MVertex*> all;
for (int i=0;i<d.size() ; i++){
for (unsigned int i = 0; i < d.size(); i++){
MElement *e = d[i];
int n = e->getNumPrimaryVertices();
for (int j = 0; j < n; j++){
......@@ -38,7 +38,7 @@ void addOneLayer ( const std::vector<MElement*> & v,
std::sort(d.begin(), d.end());
for (int i=0;i<v.size() ; i++){
for (unsigned int i = 0; i < v.size(); i++){
MElement *e = v[i];
bool found = std::binary_search(d.begin(), d.end(), e);
// element is not yet there
......@@ -106,7 +106,7 @@ void gmshHighOrderSmoother::smooth ( std::vector<MElement*> & all) {
// printf("%d elements in the next layer\n",layer.size());
for (int i=0;i<layer.size() ; i++){
for (unsigned int i = 0; i < layer.size(); i++){
for (int j = 0; j < layer[i]->getNumVertices(); j++){
MVertex *vert = layer[i]->getVertex(j);
myAssembler.fixVertex(vert, 0, getTag(), 0);
......@@ -121,7 +121,7 @@ void gmshHighOrderSmoother::smooth ( std::vector<MElement*> & all) {
// printf("%d vertices \n", _displ.size());
for (int i=0;i<v.size() ; i++){
for (unsigned int i = 0; i < v.size(); i++){
for (int j = 0; j < v[i]->getNumVertices(); j++){
MVertex *vert = v[i]->getVertex(j);
// printf("%d %d %d v\n",i,j,v[i]->getNumVertices());
......@@ -151,7 +151,7 @@ void gmshHighOrderSmoother::smooth ( std::vector<MElement*> & all) {
}
// number the other DOFs
for (int i=0;i<v.size() ; i++){
for (unsigned int i = 0; i < v.size(); i++){
for (int j = 0; j < v[i]->getNumVertices(); j++){
MVertex *vert = v[i]->getVertex(j);
myAssembler.numberVertex(vert, 0, getTag());
......
......@@ -40,7 +40,7 @@ public:
{
std::vector<std::pair<gmshDofKey, double> > constraint;
gmshDofKey key(v, iComp, iField);
for (int i=0;i<verts.size();i++){
for (unsigned int i = 0; i < verts.size(); i++){
gmshDofKey key2 (verts[i],iComp,iField);
constraint.push_back(std::make_pair(key2, coeffs[i]));
}
......@@ -91,7 +91,7 @@ public:
const_iterator itConstr = constraints.find(key);
if (itConstr != constraints.end()){
double val = 0;
for (int i = 0; i < itConstr->second.size(); i++){
for (unsigned int i = 0; i < itConstr->second.size(); i++){
const gmshDofKey &dofKeyConstr = itConstr->second[i].first;
double valConstr = itConstr->second[i].second;
val += getDofValue(dofKeyConstr.v, dofKeyConstr.comp, dofKeyConstr.field)
......
......@@ -5,6 +5,7 @@ class gmshFunction {
double _val;
public :
gmshFunction(double val = 0) : _val(val) {}
virtual ~gmshFunction(){}
virtual double operator () (double x, double y, double z) const { return _val; }
};
......
......@@ -12,8 +12,7 @@
class gmshLinearSystemGmm : public gmshLinearSystem {
gmm::row_matrix<gmm::wsvector<double> > *_a;
std::vector<double> *_x;
std::vector<double> *_b;
std::vector<double> *_b, *_x;
public :
gmshLinearSystemGmm () : _a(0), _b(0), _x(0) {}
virtual bool isAllocated () const {return _a != 0;}
......@@ -58,7 +57,7 @@ public :
}
virtual void zeroRightHandSide ()
{
for (int i=0;i<_b->size();i++)(*_b)[i] = 0;
for (unsigned int i = 0; i < _b->size(); i++) (*_b)[i] = 0;
}
virtual int systemSolve ()
{
......@@ -68,6 +67,7 @@ public :
//iter.set_noisy(2);
//gmm::gmres(*_a, *_x, *_b, P, 100, iter); // execute the GMRES algorithm
gmm::cg(*_a, *_x, *_b, P, iter); // execute the CG algorithm
return 1;
}
};
......
......@@ -47,7 +47,7 @@ void gmshNodalFemTerm::addToMatrix (gmshAssembler &lsys) const
void gmshNodalFemTerm::addToMatrix(gmshAssembler &lsys,const std::vector<MElement*> &v) const
{
for (int i=0;i<v.size();i++)
for (unsigned int i = 0; i < v.size(); i++)
addToMatrix(lsys, v[i]);
}
......
......@@ -20,6 +20,7 @@ protected:
GModel *_gm;
public:
gmshTermOfFormulation(GModel *gm) : _gm(gm) {}
virtual ~gmshTermOfFormulation(){}
virtual void addToMatrix(gmshAssembler&) const = 0;
virtual void addToRightHandSide(gmshAssembler&) const = 0;
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment