add method to access the sum of weights

This commit is contained in:
Sébastien Loriot 2016-07-15 09:51:27 +02:00
parent b899dc4549
commit fd39972166
2 changed files with 10 additions and 0 deletions

View File

@ -84,6 +84,12 @@ public:
++(*this); ++(*this);
return tmp; return tmp;
} }
double sum_of_weights() const
{
if (weights.empty())
return 0;
return weights.back();
}
}; };
template < typename Id, class ObjectFromIdMap, class GeneratorOnObject, class P > template < typename Id, class ObjectFromIdMap, class GeneratorOnObject, class P >

View File

@ -347,6 +347,10 @@ public:
++(*this); ++(*this);
return tmp; return tmp;
} }
double mesh_area() const
{
this->sum_of_weights();
}
}; };
namespace internal namespace internal